~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to storage/falcon/BackLog.cpp

auto-merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 MySQL AB
 
1
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
2
2
 
3
3
   This program is free software; you can redistribute it and/or modify
4
4
   it under the terms of the GNU General Public License as published by
59
59
 
60
60
int32 BackLog::save(RecordVersion* record)
61
61
{
 
62
        // Write the record and entire prior version chain
 
63
        // into a single backlog record
 
64
 
62
65
        Serialize stream;
63
66
        record->serialize(&stream);
64
67
        int32 backlogId = section->insertStub(NO_TRANSACTION);
96
99
                {
97
100
                RecordVersion *record = fetch(backlogId);
98
101
                
99
 
                if (record->transactionId != transaction->transactionId)
 
102
                if (record->getTransactionId() != transaction->transactionId)
100
103
                        {
101
 
                        record->release();
 
104
                        record->release(REC_HISTORY);
102
105
                        
103
106
                        continue;
104
107
                        }
107
110
                
108
111
                if (!table->insertIntoTree(record, NULL, record->recordNumber))
109
112
                        {
110
 
                        record->release();
 
113
                        record->release(REC_HISTORY);
111
114
                        int32 recordNumber = record->recordNumber;
112
115
                        Record *rec = table->fetch(recordNumber);
113
116
                        
116
119
                                if (rec->getTransactionId() == transaction->transactionId)
117
120
                                        record->rollback(transaction);
118
121
                                else
119
 
                                        record->release();
 
122
                                        record->release(REC_HISTORY);
120
123
                                }
121
124
                                
122
125
                        continue;
123
126
                        }
124
127
                        
125
128
                record->rollback(transaction);
126
 
#ifdef CHECK_RECORD_ACTIVITY
127
 
                record->active = false;
128
 
#endif
129
 
                record->release();
 
129
                SET_RECORD_ACTIVE(record, false);
 
130
                record->release(REC_HISTORY);
130
131
                }
131
132
}
132
133