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

📄 trx0trx.h

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************The transaction(c) 1996 Innobase OyCreated 3/26/1996 Heikki Tuuri*******************************************************/#ifndef trx0trx_h#define trx0trx_h#include "univ.i"#include "trx0types.h"#include "lock0types.h"#include "usr0types.h"#include "que0types.h"#include "mem0mem.h"#include "read0types.h"#include "dict0types.h"#include "trx0xa.h"extern ulint	trx_n_mysql_transactions;/*****************************************************************Resets the new record lock info in a transaction struct. */UNIV_INLINEvoidtrx_reset_new_rec_lock_info(/*========================*/	trx_t*	trx);	/* in: transaction struct *//*****************************************************************Registers that we have set a new record lock on an index. We only have spaceto store 2 indexes! If this is called to store more than 2 indexes aftertrx_reset_new_rec_lock_info(), then this function does nothing. */UNIV_INLINEvoidtrx_register_new_rec_lock(/*======================*/	trx_t*		trx,	/* in: transaction struct */	dict_index_t*	index);	/* in: trx sets a new record lock on this				index *//*****************************************************************Checks if trx has set a new record lock on an index. */UNIV_INLINEibooltrx_new_rec_locks_contain(/*======================*/				/* out: TRUE if trx has set a new record lock				on index */	trx_t*		trx,	/* in: transaction struct */	dict_index_t*	index);	/* in: index *//************************************************************************Releases the search latch if trx has reserved it. */voidtrx_search_latch_release_if_reserved(/*=================================*/        trx_t*     trx); /* in: transaction *//**********************************************************************Set detailed error message for the transaction. */voidtrx_set_detailed_error(/*===================*/	trx_t*		trx,	/* in: transaction struct */	const char*	msg);	/* in: detailed error message *//*****************************************************************Set detailed error message for the transaction from a file. Note that thefile is rewinded before reading from it. */voidtrx_set_detailed_error_from_file(/*=============================*/	trx_t*	trx,	/* in: transaction struct */	FILE*	file);	/* in: file to read message from *//********************************************************************Retrieves the error_info field from a trx. */void*trx_get_error_info(/*===============*/		     /* out: the error info */	trx_t*  trx); /* in: trx object *//********************************************************************Creates and initializes a transaction object. */trx_t*trx_create(/*=======*/			/* out, own: the transaction */	sess_t*	sess);	/* in: session or NULL *//************************************************************************Creates a transaction object for MySQL. */trx_t*trx_allocate_for_mysql(void);/*========================*/				/* out, own: transaction object *//************************************************************************Creates a transaction object for background operations by the master thread. */trx_t*trx_allocate_for_background(void);/*=============================*/				/* out, own: transaction object *//************************************************************************Frees a transaction object. */voidtrx_free(/*=====*/	trx_t*	trx);	/* in, own: trx object *//************************************************************************Frees a transaction object for MySQL. */voidtrx_free_for_mysql(/*===============*/	trx_t*	trx);	/* in, own: trx object *//************************************************************************Frees a transaction object of a background operation of the master thread. */voidtrx_free_for_background(/*====================*/	trx_t*	trx);	/* in, own: trx object *//********************************************************************Creates trx objects for transactions and initializes the trx list oftrx_sys at database start. Rollback segment and undo log lists mustalready exist when this function is called, because the lists oftransactions to be rolled back or cleaned up are built based on theundo log lists. */voidtrx_lists_init_at_db_start(void);/*============================*//********************************************************************Starts a new transaction. */ibooltrx_start(/*======*/			/* out: TRUE if success, FALSE if the rollback			segment could not support this many transactions */	trx_t* 	trx,	/* in: transaction */	ulint	rseg_id);/* in: rollback segment id; if ULINT_UNDEFINED			is passed, the system chooses the rollback segment			automatically in a round-robin fashion *//********************************************************************Starts a new transaction. */ibooltrx_start_low(/*==========*/			/* out: TRUE */	trx_t* 	trx,	/* in: transaction */	ulint	rseg_id);/* in: rollback segment id; if ULINT_UNDEFINED			is passed, the system chooses the rollback segment			automatically in a round-robin fashion *//*****************************************************************Starts the transaction if it is not yet started. */UNIV_INLINEvoidtrx_start_if_not_started(/*=====================*/	trx_t*	trx);	/* in: transaction *//*****************************************************************Starts the transaction if it is not yet started. Assumes we have reservedthe kernel mutex! */UNIV_INLINEvoidtrx_start_if_not_started_low(/*=========================*/	trx_t*	trx);	/* in: transaction *//*****************************************************************Starts the transaction if it is not yet started. */voidtrx_start_if_not_started_noninline(/*===============================*/	trx_t*	trx);	/* in: transaction *//********************************************************************Commits a transaction. */voidtrx_commit_off_kernel(/*==================*/	trx_t*	trx);	/* in: transaction *//********************************************************************Cleans up a transaction at database startup. The cleanup is needed ifthe transaction already got to the middle of a commit when the databasecrashed, andf we cannot roll it back. */voidtrx_cleanup_at_db_startup(/*======================*/	trx_t*	trx);	/* in: transaction *//**************************************************************************Does the transaction commit for MySQL. */ulinttrx_commit_for_mysql(/*=================*/			/* out: 0 or error number */	trx_t*	trx);	/* in: trx handle *//**************************************************************************Does the transaction prepare for MySQL. */ulinttrx_prepare_for_mysql(/*=================*/			/* out: 0 or error number */	trx_t*	trx);	/* in: trx handle *//**************************************************************************This function is used to find number of prepared transactions andtheir transaction objects for a recovery. */inttrx_recover_for_mysql(/*==================*/				/* out: number of prepared transactions */	XID*    xid_list, 	/* in/out: prepared transactions */	ulint	len);		/* in: number of slots in xid_list *//***********************************************************************This function is used to find one X/Open XA distributed transactionwhich is in the prepared state */trx_t *trx_get_trx_by_xid(/*===============*/			/* out: trx or NULL */	XID*	xid);	/*  in: X/Open XA transaction identification *//**************************************************************************If required, flushes the log to disk if we called trx_commit_for_mysql()with trx->flush_log_later == TRUE. */ulinttrx_commit_complete_for_mysql(/*==========================*/			/* out: 0 or error number */	trx_t*	trx);	/* in: trx handle *//**************************************************************************Marks the latest SQL statement ended. */voidtrx_mark_sql_stat_end(/*==================*/	trx_t*	trx);	/* in: trx handle *//************************************************************************Assigns a read view for a consistent read query. All the consistent readswithin the same transaction will get the same read view, which is createdwhen this function is first called for a new started transaction. */read_view_t*trx_assign_read_view(/*=================*/			/* out: consistent read view */	trx_t*	trx);	/* in: active transaction *//***************************************************************The transaction must be in the TRX_QUE_LOCK_WAIT state. Puts it tothe TRX_QUE_RUNNING state and releases query threads which werewaiting for a lock in the wait_thrs list. */voidtrx_end_lock_wait(/*==============*/	trx_t*	trx);	/* in: transaction *//********************************************************************Sends a signal to a trx object. */ibooltrx_sig_send(/*=========*/					/* out: TRUE if the signal was					successfully delivered */	trx_t*		trx,		/* in: trx handle */	ulint		type,		/* in: signal type */	ulint		sender,		/* in: TRX_SIG_SELF or					TRX_SIG_OTHER_SESS */	que_thr_t*	receiver_thr,	/* in: query thread which wants the					reply, or NULL; if type is					TRX_SIG_END_WAIT, this must be NULL */	trx_savept_t* 	savept,		/* in: possible rollback savepoint, or					NULL */	que_thr_t**	next_thr);	/* in/out: next query thread to run;					if the value which is passed in is					a pointer to a NULL pointer, then the					calling function can start running					a new query thread; if the parameter					is NULL, it is ignored *//********************************************************************Send the reply message when a signal in the queue of the trx hasbeen handled. */voidtrx_sig_reply(/*==========*/	trx_sig_t*	sig,		/* in: signal */	que_thr_t**	next_thr);	/* in/out: next query thread to run;					if the value which is passed in is					a pointer to a NULL pointer, then the					calling function can start running					a new query thread *//********************************************************************Removes the signal object from a trx signal queue. */voidtrx_sig_remove(/*===========*/	trx_t*		trx,	/* in: trx handle */	trx_sig_t*	sig);	/* in, own: signal *//********************************************************************Starts handling of a trx signal. */voidtrx_sig_start_handle(/*=================*/	trx_t*		trx,		/* in: trx handle */	que_thr_t**	next_thr);	/* in/out: next query thread to run;					if the value which is passed in is					a pointer to a NULL pointer, then the					calling function can start running					a new query thread *//********************************************************************Ends signal handling. If the session is in the error state, andtrx->graph_before_signal_handling != NULL, returns control to the errorhandling routine of the graph (currently only returns the control to thegraph root which then sends an error message to the client). */voidtrx_end_signal_handling(/*====================*/	trx_t*	trx);	/* in: trx *//*************************************************************************Creates a commit command node struct. */commit_node_t*commit_node_create(/*===============*/				/* out, own: commit node struct */	mem_heap_t*	heap);	/* in: mem heap where created *//***************************************************************Performs an execution step for a commit type node in a query graph. */que_thr_t*trx_commit_step(/*============*/				/* out: query thread to run next, or NULL */	que_thr_t*	thr);	/* in: query thread *//**************************************************************************Prints info about a transaction to the given file. The caller must own thekernel mutex and must have calledinnobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQLor InnoDB cannot meanwhile change the info printed here. */voidtrx_print(/*======*/	FILE*	f,		/* in: output stream */	trx_t*	trx,		/* in: transaction */	uint	max_query_len);	/* in: max query length to print, or 0 to				   use the default max length */#ifndef UNIV_HOTBACKUP/**************************************************************************Determines if the currently running transaction has been interrupted. */ibooltrx_is_interrupted(/*===============*/			/* out: TRUE if interrupted */	trx_t*	trx);	/* in: transaction */#else /* !UNIV_HOTBACKUP */#define trx_is_interrupted(trx) FALSE#endif /* !UNIV_HOTBACKUP *//* Signal to a transaction */struct trx_sig_struct{	ulint		type;		/* signal type */	ulint		state;		/* TRX_SIG_WAITING or					TRX_SIG_BEING_HANDLED */	ulint		sender;		/* TRX_SIG_SELF or

⌨️ 快捷键说明

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