~skinny.moey/drizzle/innodb-replication

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-11-08 22:35:57 UTC
  • mfrom: (1802.1.114 trunk)
  • Revision ID: brian@tangent.org-20101108223557-w3xzwp9hjjtjhtc1
MergeĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 *
19
19
 * Barry Leslie
20
20
 *
28
28
 */
29
29
 
30
30
#include "cslib/CSConfig.h"
 
31
 
31
32
#include <inttypes.h>
32
33
 
 
34
#include "defs_ms.h"
 
35
 
33
36
#include "cslib/CSGlobal.h"
34
37
#include "cslib/CSStrUtil.h"
35
38
#include "cslib/CSLog.h"
36
39
 
37
 
#include "defs_ms.h"
38
40
#include "mysql_ms.h"
39
41
#include "open_table_ms.h"
40
42
#include "trans_log_ms.h"
177
179
 
178
180
void MSTransactionThread::dereference(MSTransPtr rec, MS_TxnState state)
179
181
{
180
 
        MSOpenTable             *otab;
181
182
        enter_();
182
183
        
183
184
        try_(a) {
 
185
                MSOpenTable             *otab;
184
186
                otab = MSTableList::getOpenTableByID(rec->tr_db_id, rec->tr_tab_id);
185
187
                frompool_(otab);
186
188
                otab->freeReference(rec->tr_blob_id, rec->tr_blob_ref_id);
197
199
 
198
200
void MSTransactionThread::commitReference(MSTransPtr rec, MS_TxnState state)
199
201
{
200
 
        MSOpenTable             *otab;
201
202
        enter_();
202
203
        
203
204
        try_(a) {
 
205
                MSOpenTable             *otab;
204
206
                otab = MSTableList::getOpenTableByID(rec->tr_db_id, rec->tr_tab_id);
205
207
                frompool_(otab);
206
208
                otab->commitReference(rec->tr_blob_id, rec->tr_blob_ref_id);
235
237
 
236
238
bool MSTransactionThread::doWork()
237
239
{
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;
243
245
                while (!myMustQuit) {
244
246
                        // This will sleep while waiting for the next 
245
247
                        // completed transaction.
410
412
        exit_();
411
413
}
412
414
 
413
 
class MSTransactionCheckPoint: public CSCString
 
415
class MSTransactionCheckPoint: public CSString
414
416
{
415
417
        public:
416
 
        MSTransactionCheckPoint(const char *name, uint32_t stmtCount ):CSCString()
 
418
        MSTransactionCheckPoint(const char *name, uint32_t stmtCount ):CSString(name)
417
419
        {
418
 
                myCString = cs_strdup(name);
419
 
                myStrLen = strlen(name);
420
 
 
421
420
                position = stmtCount;
422
421
        }
423
422
        
442
441
void MSTransactionManager::releaseSavepoint(const char *savePoint)
443
442
{
444
443
        MSTransactionCheckPoint *checkPoint;
445
 
        CSCString *name;
 
444
        CSString *name;
446
445
        enter_();
447
446
        
448
 
        name = CSCString::newString(savePoint);
 
447
        name = CSString::newString(savePoint);
449
448
        push_(name);
450
449
 
451
450
        checkPoint = (MSTransactionCheckPoint*) self->mySavePoints.find(name);
460
459
void MSTransactionManager::rollbackTo(const char *savePoint)
461
460
{
462
461
        MSTransactionCheckPoint *checkPoint;
463
 
        CSCString *name;
 
462
        CSString *name;
464
463
        enter_();
465
464
        
466
 
        name = CSCString::newString(savePoint);
 
465
        name = CSString::newString(savePoint);
467
466
        push_(name);
468
467
 
469
468
        checkPoint = (MSTransactionCheckPoint*) self->mySavePoints.find(name);