mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
e4be45da93
BitKeeper/etc/logging_ok: auto-union BUILD/autorun.sh: Auto merged BitKeeper/etc/config: Auto merged Makefile.am: Auto merged include/my_bitmap.h: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged mysys/Makefile.am: Auto merged mysys/default.c: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/Makefile.am: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_udf.cc: Auto merged sql/sql_yacc.yy: Auto merged storage/heap/Makefile.am: Auto merged storage/heap/hp_hash.c: Auto merged storage/innobase/btr/btr0btr.c: Auto merged storage/innobase/btr/btr0cur.c: Auto merged storage/innobase/configure.in: Auto merged storage/innobase/fil/fil0fil.c: Auto merged storage/innobase/ibuf/ibuf0ibuf.c: Auto merged storage/innobase/include/os0file.h: Auto merged storage/innobase/include/page0cur.h: Auto merged storage/innobase/include/row0mysql.h: Auto merged storage/innobase/include/srv0srv.h: Auto merged storage/innobase/include/trx0trx.h: Auto merged storage/innobase/include/trx0trx.ic: Auto merged storage/innobase/lock/lock0lock.c: Auto merged storage/innobase/log/log0recv.c: Auto merged storage/innobase/os/os0file.c: Auto merged storage/innobase/page/page0cur.c: Auto merged storage/innobase/page/page0page.c: Auto merged storage/innobase/rem/rem0rec.c: Auto merged storage/innobase/row/row0mysql.c: Auto merged storage/innobase/row/row0sel.c: Auto merged storage/innobase/row/row0upd.c: Auto merged storage/innobase/srv/srv0srv.c: Auto merged storage/innobase/trx/trx0trx.c: Auto merged storage/innobase/trx/trx0undo.c: Auto merged storage/myisam/Makefile.am: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_unique.c: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisammrg/Makefile.am: Auto merged storage/ndb/include/mgmcommon/ConfigRetriever.hpp: Auto merged storage/ndb/include/transporter/TransporterDefinitions.hpp: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged storage/ndb/test/ndbapi/create_tab.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-ucs2.c: Auto merged support-files/mysql.spec.sh: Auto merged configure.in: merge mysql-test/t/disabled.def: merge mysys/my_bitmap.c: SCCS merged sql/ha_federated.cc: merge sql/ha_innodb.cc: merge sql/ha_ndbcluster.cc: merge sql/mysqld.cc: e merge sql/sql_insert.cc: merge sql/sql_lex.h: merge sql/sql_load.cc: merge sql/sql_select.cc: merge e C sql/sql_update.cc: merge sql/table.cc: merge
98 lines
2.4 KiB
Text
98 lines
2.4 KiB
Text
/******************************************************
|
|
The transaction
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
Created 3/26/1996 Heikki Tuuri
|
|
*******************************************************/
|
|
|
|
/*****************************************************************
|
|
Starts the transaction if it is not yet started. */
|
|
UNIV_INLINE
|
|
void
|
|
trx_start_if_not_started(
|
|
/*=====================*/
|
|
trx_t* trx) /* in: transaction */
|
|
{
|
|
ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
|
|
|
|
if (trx->conc_state == TRX_NOT_STARTED) {
|
|
|
|
trx_start(trx, ULINT_UNDEFINED);
|
|
}
|
|
}
|
|
|
|
/*****************************************************************
|
|
Starts the transaction if it is not yet started. Assumes we have reserved
|
|
the kernel mutex! */
|
|
UNIV_INLINE
|
|
void
|
|
trx_start_if_not_started_low(
|
|
/*=========================*/
|
|
trx_t* trx) /* in: transaction */
|
|
{
|
|
ut_ad(trx->conc_state != TRX_COMMITTED_IN_MEMORY);
|
|
|
|
if (trx->conc_state == TRX_NOT_STARTED) {
|
|
|
|
trx_start_low(trx, ULINT_UNDEFINED);
|
|
}
|
|
}
|
|
|
|
/*****************************************************************
|
|
Resets the new record lock info in a transaction struct. */
|
|
UNIV_INLINE
|
|
void
|
|
trx_reset_new_rec_lock_info(
|
|
/*========================*/
|
|
trx_t* trx) /* in: transaction struct */
|
|
{
|
|
trx->new_rec_locks[0] = NULL;
|
|
trx->new_rec_locks[1] = NULL;
|
|
}
|
|
|
|
/*****************************************************************
|
|
Registers that we have set a new record lock on an index. We only have space
|
|
to store 2 indexes! If this is called to store more than 2 indexes after
|
|
trx_reset_new_rec_lock_info(), then this function does nothing. */
|
|
UNIV_INLINE
|
|
void
|
|
trx_register_new_rec_lock(
|
|
/*======================*/
|
|
trx_t* trx, /* in: transaction struct */
|
|
dict_index_t* index) /* in: trx sets a new record lock on this
|
|
index */
|
|
{
|
|
if (trx->new_rec_locks[0] == NULL) {
|
|
trx->new_rec_locks[0] = index;
|
|
|
|
return;
|
|
}
|
|
|
|
if (trx->new_rec_locks[0] == index) {
|
|
|
|
return;
|
|
}
|
|
|
|
if (trx->new_rec_locks[1] != NULL) {
|
|
|
|
return;
|
|
}
|
|
|
|
trx->new_rec_locks[1] = index;
|
|
}
|
|
|
|
/*****************************************************************
|
|
Checks if trx has set a new record lock on an index. */
|
|
UNIV_INLINE
|
|
ibool
|
|
trx_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 */
|
|
{
|
|
return(trx->new_rec_locks[0] == index
|
|
|| trx->new_rec_locks[1] == index);
|
|
}
|