~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: lbieber
  • Date: 2010-09-07 22:29:56 UTC
  • mfrom: (1747.1.3 build)
  • Revision ID: lbieber@orisndriz03-20100907222956-d60u695b7hx3zs0d
Merge Andrew - bug 597778 - Timestamp cannot reliably store leap seconds, so don't try. Leave that to datetime only
Merge Andrew - bug 621862 - Add / clean-up error messages for unireg_abort
Merge Andrew - bug 629563 - Drop the broken --mysql options and Change the --protocol option to accept 'mysql' or 'drizzle' ('mysql' currently default)

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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
18
 *
19
19
 * Barry Leslie
20
20
 *
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);