⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transaction.c

📁 一个内存数据库的源代码这是服务器端还有客户端
💻 C
字号:
#line 66 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/transaction.mx"#include "mal_config.h"#include "gdk.h"#include "mal.h"#include "mal_interpreter.h"#include "bat5.h"#ifdef WIN32#ifndef LIBTRANSACTION#define transaction_export extern __declspec(dllimport)#else#define transaction_export extern __declspec(dllexport)#endif#else#define transaction_export extern#endiftransaction_export str TRNglobal_sync(int *ret);transaction_export str TRNglobal_abort(int *ret);transaction_export str TRNglobal_commit(int *ret);transaction_export str TRNsub_commit(int *ret, int *bid);transaction_export str TRNtrans_clean(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);transaction_export str TRNtrans_abort(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);transaction_export str TRNtrans_commit(MalBlkPtr mb, MalStkPtr stk, InstrPtr p);transaction_export str TRNsubcommit(int *ret, int *bid);transaction_export str TRNtrans_prev(int *ret, int *bid);transaction_export str TRNtrans_alpha(int *ret, int *bid);transaction_export str TRNtrans_delta(int *ret, int *bid);#line 99 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/transaction.mx"#include "mal_exception.h"strTRNglobal_sync(int *ret){	*ret = BBPsync(BBPsize,NULL)?FALSE:TRUE;	return MAL_SUCCEED;}strTRNglobal_abort(int *ret){	*ret = TMabort()?FALSE:TRUE;	return MAL_SUCCEED;}strTRNglobal_commit(int *ret){	*ret = TMcommit()?FALSE:TRUE;	return MAL_SUCCEED;}strTRNsubcommit(int *ret, int *bid){	BAT *b;	b= BATdescriptor(*bid);	if( b == NULL)		throw(MAL, "transaction.subcommit","BAT with commit list missing");	*ret = TMsubcommit(b)?FALSE:TRUE;	BBPunfix(b->batCacheid);	return MAL_SUCCEED;}strTRNtrans_clean(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	int i, *bid;	BAT *b;	(void) mb;	for (i = p->retc; i < p->argc; i++) {		bid = (int *) getArgReference(stk, p, i);		if ((b = BATdescriptor(*bid)) == NULL) {			throw(MAL, "transaction.commit", "Cannot access descriptor");		}		if (b)			BATfakeCommit(b);		else			throw(MAL, "trans_commit", "BAT not accessible");		BBPunfix(b->batCacheid);	}	return MAL_SUCCEED;}strTRNtrans_abort(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	int i, *bid;	BAT *b;	(void) mb;	for (i = p->retc; i < p->argc; i++) {		bid = (int *) getArgReference(stk, p, i);		if ((b = BATdescriptor(*bid)) == NULL) {			throw(MAL, "transaction.abort", "Cannot access descriptor");		}		if (b)			BATundo(b);		else			throw(MAL, "transaction.abort", "BAT not accessible");		BBPunfix(b->batCacheid);	}	return MAL_SUCCEED;}strTRNtrans_commit(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){	int i, *bid;	BAT *b;	(void) mb;	for (i = p->retc; i < p->argc; i++) {		bid = (int *) getArgReference(stk, p, i);		if ((b = BATdescriptor(*bid)) == NULL) {			throw(MAL, "transaction.commit", "Cannot access descriptor");		}		if (b)			BATcommit(b);		else			throw(MAL, "transaction.commit", "BAT not accessible");		BBPunfix(b->batCacheid);	}	return MAL_SUCCEED;}strTRNtrans_prev(int *ret, int *bid){	BAT *b,*bn= NULL;	b= BATdescriptor(*bid);	if (b  == NULL) 		throw(MAL, "transaction.prev", "Cannot access descriptor");	bn = BATprev(b);	BBPkeepref(*ret = bn->batCacheid);	BBPunfix(b->batCacheid);	return MAL_SUCCEED;}strTRNtrans_alpha(int *ret, int *bid){	return BKCgetAlpha(ret, bid);}strTRNtrans_delta(int *ret, int *bid){	return BKCgetDelta(ret, bid);}#line 221 "/export/scratch0/monet/monet.GNU.64.64.d.14791/MonetDB5/src/modules/mal/transaction.mx"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -