2005-10-27 07:29:40 +00:00
|
|
|
/******************************************************
|
|
|
|
The transaction
|
|
|
|
|
|
|
|
(c) 1996 Innobase Oy
|
|
|
|
|
|
|
|
Created 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"
|
branches/innodb+: Merge revisions 2867:2986 from branches/zip:
------------------------------------------------------------------------
r2867 | marko | 2008-10-24 10:24:17 +0300 (Fri, 24 Oct 2008) | 2 lines
branches/zip: ChangeLog: Document r2763, r2794, r2683, r2799, r2809, r2866.
------------------------------------------------------------------------
r2869 | vasil | 2008-10-24 11:14:16 +0300 (Fri, 24 Oct 2008) | 4 lines
branches/zip:
White space cleanup in ChangeLog
------------------------------------------------------------------------
r2870 | vasil | 2008-10-24 13:36:14 +0300 (Fri, 24 Oct 2008) | 8 lines
branches/zip:
Remove a statement that causes the innodb-index test to fail.
The change in behavior was introduced in MySQL BZR-r2738.
Suggested by: Marko
------------------------------------------------------------------------
r2871 | vasil | 2008-10-24 13:48:38 +0300 (Fri, 24 Oct 2008) | 5 lines
branches/zip:
Adjust mysql-test/patches/innodb-index.diff after the change to
mysql-test/innodb-index.(test|result) in r2870.
------------------------------------------------------------------------
r2878 | calvin | 2008-10-27 11:05:42 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: port the fix of Bug#19424 - InnoDB: Possibly a memory
overrun of the buffer being freed with 64-bit Microsoft Visual C++.
The changed file:
CMakeLists.txt: Removing Win64 compiler optimizations for all
innodb/mem/* files.
------------------------------------------------------------------------
r2884 | vasil | 2008-10-27 11:48:46 +0200 (Mon, 27 Oct 2008) | 7 lines
branches/zip:
ChangeLog:
Add entry for the fix of Bug#19424 InnoDB: Possibly a memory overrun of
the buffer being freed (64-bit Visual C)
------------------------------------------------------------------------
r2886 | calvin | 2008-10-27 22:39:11 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: This patch is to solve the issue that file handles can
not cross DLL/EXE boundaries on Windows. In builtin InnoDB, it makes
call to MySQL server for creating tmp files. innobase_mysql_tmpfile
is now rewritten for the plugin.
rb://5
Approved by: Marko
------------------------------------------------------------------------
r2887 | calvin | 2008-10-27 22:48:29 +0200 (Mon, 27 Oct 2008) | 44 lines
branches/zip: implement the delayloading of externals for the plugin
on Windows, which includes:
* Load mysqld.map and insert all symbol/address pairs into hash for
quick access
* Resolves all external data variables. The delayloading mechanism
in MSVC does not support automatic imports of data variables.
A workaround is to explicitly handle the data import using the delay
loader during the initialization of the plugin.
* Resolves all external functions during run-time, by implementing
the delayed loading helper function delayLoadHelper2, which is
called by run-time as well as HrLoadAllImportsForDll.
The delay loader reuses the hash implementation in InnoDB. The normal
hash_create (in hash0hash.c) creates hash tables in buffer pool. But
the delay loader is invoked before the engine is initialized, and
buffer pools are not ready yet. Instead, the delay loader has its own
implementation of hash_create() and hash_table_free(), called
wdl_hash_create() and wdl_hash_table_free().
This patch should be used with other two patches in order to build
a dynamically linked plugin on Windows:
* patch for tmpfile functions (r2886)
* patch for "build" files (to be committed)
The list of file changed:
handler/handler0vars.h: new file, defines a list of external data
variables (no external functions).
handler/win_delay_loader.cc: new file, the implementation of the delay
loader for Windows plugin.
handler/ha_innodb.cc: add a header file, and changes for copying the
system variables.
handler/handler0alter.cc: add a header file
handler/i_s.cc: add a header file
rb://27
Reviewed by: Sunny, Marko
Approved by: Sunny
------------------------------------------------------------------------
r2888 | calvin | 2008-10-28 01:51:49 +0200 (Tue, 28 Oct 2008) | 25 lines
branches/zip: for building dynamic plugin on Windows, ha_innodb.dll,
when INNODB_DYNAMIC_PLUGIN is specified.
The changes are:
CMakeLists.txt: add project ha_innodb for dynamic plugin on Windows.
ha_innodb depends on project mysqld.
ha_innodb.def: a new file with standard exports for a dynamic plugin.
Two new files will be added:
* sql/mysqld.def: .def file for 32-bit compiler
* sql/mysqld_x64.def: .def file for x64 compiler
It is also required to apply a patch to the MySQL source tree. The
patch is described in win-plugin/README:
win-plugin/win-plugin.diff - a patch to be applied to MySQL source
tree. When applied, the following files will be modified:
* CMakeLists.txt: add INNODB_DYNAMIC_PLUGIN and _USE_32BIT_TIME_T
* sql/CMakeLists.txt: add mysqld.def or mysqld_x64.def for mysqld
* win/configure.js: add INNODB_DYNAMIC_PLUGIN
* win/build-vs71.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8_x64.bat: provide an option to specify CMAKE_BUILD_TYPE
------------------------------------------------------------------------
r2894 | marko | 2008-10-28 08:36:39 +0200 (Tue, 28 Oct 2008) | 4 lines
branches/zip: dict_str_starts_with_keyword(): Removed this unused function.
Spotted by Sunny.
------------------------------------------------------------------------
r2895 | vasil | 2008-10-28 08:40:45 +0200 (Tue, 28 Oct 2008) | 6 lines
branches/zip:
ChangeLog:
add entry for the Windows plugin.
------------------------------------------------------------------------
r2917 | marko | 2008-10-28 23:53:23 +0200 (Tue, 28 Oct 2008) | 3 lines
branches/zip: innodb_plugin_init(): Do not copy session variables,
even when the variable is a global variable in the built-in InnoDB.
------------------------------------------------------------------------
r2918 | calvin | 2008-10-29 00:08:11 +0200 (Wed, 29 Oct 2008) | 2 lines
branches/zip: fix a problem introduced in r2917 - dyn is not
initialized. Move the check into for().
------------------------------------------------------------------------
r2922 | calvin | 2008-10-29 08:29:01 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: fix issue #102 - Windows plugin: resolve dbug functions
during run-time.
Implement wrapper functions in the plugin. The plugin will get the
function entries from mysqld.exe during the init, and invoke the
corresponding functions (in mysqld.exe). The list of functions are:
_db_pargs_
_db_doprnt_
_db_enter_
_db_return_
_db_dump_
rb://38
Approved by: Marko
------------------------------------------------------------------------
r2923 | marko | 2008-10-29 09:52:30 +0200 (Wed, 29 Oct 2008) | 1 line
branches/zip: ChangeLog: Mention Bug #27276.
------------------------------------------------------------------------
r2925 | calvin | 2008-10-29 10:09:41 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: change function names in sql/mysqld.def in order
to work with 5.1.29-rc.
In 5.1.29, the following function names are changed:
_hash_init
hash_free
hash_search
hash_delete
changed to
_my_hash_init
my_hash_free
my_hash_search
my_hash_delete
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2927 | marko | 2008-10-29 11:43:23 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip: ha_innodb.cc: Make some functions static, so that they will
not be compiled as weak global symbols. These functions must not be
redirected to the built-in InnoDB.
------------------------------------------------------------------------
r2928 | michael | 2008-10-29 19:20:10 +0200 (Wed, 29 Oct 2008) | 4 lines
Remove unnecessary assert
Approved by: Heikki, over IM
------------------------------------------------------------------------
r2930 | marko | 2008-10-29 21:39:24 +0200 (Wed, 29 Oct 2008) | 33 lines
branches/zip: Merge revisions 2854:2929 from branches/5.1,
except r2924, which was merged from branches/zip r2866 to branches/5.1
and except r2879 which was merged separately by Calvin:
------------------------------------------------------------------------
r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines
branches/5.1:
Fix Bug#38189 innodb_stats_on_metadata missing
Make the variable innodb_stats_on_metadata visible to the users and
also settable at runtime. Previously it was only "visible" as a command
line startup option to mysqld.
Approved by: Marko (https://svn.innodb.com/rb/r/36)
------------------------------------------------------------------------
r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines
branches/5.1: dtype_get_sql_null_size(): return the correct storage
size of a SQL NULL column. (Bug #40369)
When MySQL Bug #20877 was fixed in r834, this function was
accidentally modified to return 0 or 1. Apparently, the only impact of
this bug is that fixed-length columns cannot be updated in-place from
or to SQL NULL, even in ROW_FORMAT=REDUNDANT. After this fix,
fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant
storage size as they should, no matter if NULL or non-NULL. The bug
caused fixed-length NULL columns to occupy 1 byte.
rb://37 approved by Heikki over IM.
------------------------------------------------------------------------
------------------------------------------------------------------------
r2931 | vasil | 2008-10-29 22:10:40 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip:
Add 2 ChangeLog entries for the 2 bugfixes that were merged from branches/5.1.
------------------------------------------------------------------------
r2935 | vasil | 2008-10-30 12:17:23 +0200 (Thu, 30 Oct 2008) | 17 lines
branches/zip:
Fix "Bug#40360 Binlog related errors with binlog off" in InnoDB code in order
to have a Bug#40360-free InnoDB Plugin 1.0.2.
The fix does check whether binary logging is enabled in MySQL by accessing the
opt_bin_log global variable that is defined in sql/mysqld.cc.
In case MySQL does develop another solution to this via Bug#40360 then we can
revert this patch (except the mysql-tests).
The windows-plugin part of this fix will be committed as a separate commit to
ease eventual merge into branches/5.1 [note from the future: the separate
commit went into r2936].
Approved by: Marko (https://svn.innodb.com/rb/r/39)
------------------------------------------------------------------------
r2936 | vasil | 2008-10-30 12:24:09 +0200 (Thu, 30 Oct 2008) | 7 lines
branches/zip:
Followup to r2935: add the Windows Delay Loader stuff for the MySQL
variable that we are accessing. If someday we have another solution for
Bug#40360 Binlog related errors with binlog off
then this should also be reverted.
------------------------------------------------------------------------
r2937 | vasil | 2008-10-30 12:28:47 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Add ChangeLog entry for Bug#40360 Binlog related errors with binlog off
------------------------------------------------------------------------
r2938 | vasil | 2008-10-30 12:33:28 +0200 (Thu, 30 Oct 2008) | 5 lines
branches/zip:
Non-functional change: convert handler/handler0vars.h and
handler/win_delay_loader.cc from \r\n (dos) to \n (unix) line terminators.
------------------------------------------------------------------------
r2939 | marko | 2008-10-30 12:38:18 +0200 (Thu, 30 Oct 2008) | 2 lines
branches/zip: Set svn:eol-style native on some recently added text files.
------------------------------------------------------------------------
r2940 | marko | 2008-10-30 12:46:21 +0200 (Thu, 30 Oct 2008) | 1 line
branches/zip: ChangeLog, ha_innodb.def: Set svn:eol-style native
------------------------------------------------------------------------
r2941 | vasil | 2008-10-30 19:34:27 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Increment the InnoDB Plugin version from 1.0.1 to 1.0.2.
------------------------------------------------------------------------
r2943 | sunny | 2008-10-31 09:40:29 +0200 (Fri, 31 Oct 2008) | 15 lines
branches/zip:
1. We add a vector of locks to trx_t. This array contains the autoinc
locks granted to a transaction. There is one per table.
2. We enforce releasing of these locks in the reverse order from the
one in which they are acquired. The assumption is that since the
AUTOINC locks are statement level locks. Nested statements introduced
by triggers are stacked it should hold.
There was some cleanup done to the vector code too by adding const and
some new functions. Rename dict_table_t::auto_inc_lock to autoinc_lock.
Fix Bug#26316 Triggers create duplicate entries on auto-increment columns
rb://22
------------------------------------------------------------------------
r2944 | vasil | 2008-10-31 09:44:16 +0200 (Fri, 31 Oct 2008) | 12 lines
branches/zip:
Revert our temporary fix for "Bug#40360 Binlog related errors with binlog off"
(r2935, r2936) and deploy MySQL's one, but put the function
mysql_bin_log_is_engaged() inside mysql_addons.cc instead of in mysql's log.cc
and use a different name for it so there is no collision when MySQL adds this
function in log.cc.
[note from the future: the windows part of this patch went into r2947]
Approved by: Marko (https://svn.innodb.com/rb/r/41/)
------------------------------------------------------------------------
r2945 | sunny | 2008-10-31 09:44:45 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Update ChangeLog with r2943 info.
------------------------------------------------------------------------
r2946 | marko | 2008-10-31 10:18:47 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Revert the unintended change to univ.i that was made in r2943.
------------------------------------------------------------------------
r2947 | calvin | 2008-10-31 10:38:26 +0200 (Fri, 31 Oct 2008) | 6 lines
branches/zip: Windows plugin part of r2944
r2944 has reference to mysql_bin_log.is_open(), which is new in InnoDB.
Add two new entries and remove one duplicate in mysqld.def &
mysqld_x64.def.
------------------------------------------------------------------------
r2948 | vasil | 2008-10-31 11:39:07 +0200 (Fri, 31 Oct 2008) | 9 lines
branches/zip:
Fix Mantis issue#106 plugin init error:InnoDB: stats_on_metadata in static
InnoDB (flags=0x2401) differs from stats_on_metadata in dynamic InnoDB (fl
Ignore the NOSYSVAR flag in addition to ignoring the READONLY flag.
Approved by: Marko (https://svn.innodb.com/rb/r/42/)
------------------------------------------------------------------------
r2949 | vasil | 2008-10-31 11:47:56 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip:
White-space cleanup in ChangeLog.
------------------------------------------------------------------------
r2951 | marko | 2008-10-31 14:21:43 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip: scripts/install_innodb_plugins_win.sql: New script,
for installing the InnoDB plugins in Windows. Copied from
scripts/install_innodb_plugins.sql.
------------------------------------------------------------------------
r2954 | calvin | 2008-11-04 09:15:26 +0200 (Tue, 04 Nov 2008) | 8 lines
branches/zip: ignore the failure when builtin_innobase_plugin is not
available.
External variable builtin_innobase_plugin is not available when mysqld
does not have a builtin InnoDB. The init of the Windows plugin should
not fail in this case.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2955 | calvin | 2008-11-04 12:43:14 +0200 (Tue, 04 Nov 2008) | 11 lines
branches/zip: windows plugin - fix references to array variables.
This problem surfaced when running new test innodb_bug40360.test. Both
tx_isolation_names and binlog_format_names are name arrays, and
should be defined as wdl_tx_isolation_names and wdl_binlog_format_names,
not *wdl_tx_isolation_names and *wdl_binlog_format_names.
Another array variable is all_charsets, which is already correctly
defined.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2986 | marko | 2008-11-11 09:28:37 +0200 (Tue, 11 Nov 2008) | 11 lines
branches/zip: ha_innobase::create(): Remove the dependences on
DICT_TF_ZSSIZE_MAX, so that the code can be compiled with a different
uncompressed page size by redefining UNIV_PAGE_SIZE_SHIFT in univ.i.
Currently, the allowed values are 12, 13, or 14 (4k, 8k, 16k).
Make the default compressed page size half the uncompressed page size.
The previous default was 8 kilobytes, which is the same when compiling
with the default 16k uncompressed page size.
rb://50 approved by Pekka Lampio and Sunny Bains.
------------------------------------------------------------------------
2008-11-11 10:21:16 +00:00
|
|
|
#include "ut0vec.h"
|
2005-10-27 07:29:40 +00:00
|
|
|
|
2007-06-21 12:02:29 +00:00
|
|
|
/* Dummy session used currently in MySQL interface */
|
|
|
|
extern sess_t* trx_dummy_sess;
|
|
|
|
|
|
|
|
/* Number of transactions currently allocated for MySQL: protected by
|
|
|
|
the kernel mutex */
|
2005-10-27 07:29:40 +00:00
|
|
|
extern ulint trx_n_mysql_transactions;
|
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
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 */
|
|
|
|
/*****************************************************************
|
|
|
|
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 */
|
|
|
|
/*****************************************************************
|
|
|
|
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 */
|
|
|
|
/************************************************************************
|
|
|
|
Releases the search latch if trx has reserved it. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_search_latch_release_if_reserved(
|
|
|
|
/*=================================*/
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_t* trx); /* in: transaction */
|
2005-10-27 07:29:40 +00:00
|
|
|
/**********************************************************************
|
|
|
|
Set detailed error message for the transaction. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_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 the
|
|
|
|
file is rewinded before reading from it. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_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. */
|
2007-08-15 06:53:34 +00:00
|
|
|
UNIV_INLINE
|
|
|
|
const dict_index_t*
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_get_error_info(
|
|
|
|
/*===============*/
|
2007-08-15 06:53:34 +00:00
|
|
|
/* out: the error info */
|
|
|
|
const trx_t* trx); /* in: trx object */
|
2005-10-27 07:29:40 +00:00
|
|
|
/********************************************************************
|
|
|
|
Creates and initializes a transaction object. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_t*
|
|
|
|
trx_create(
|
|
|
|
/*=======*/
|
|
|
|
/* out, own: the transaction */
|
2007-06-21 12:02:29 +00:00
|
|
|
sess_t* sess) /* in: session */
|
|
|
|
__attribute__((nonnull));
|
2005-10-27 07:29:40 +00:00
|
|
|
/************************************************************************
|
|
|
|
Creates a transaction object for MySQL. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_t*
|
|
|
|
trx_allocate_for_mysql(void);
|
|
|
|
/*========================*/
|
|
|
|
/* out, own: transaction object */
|
|
|
|
/************************************************************************
|
|
|
|
Creates a transaction object for background operations by the master thread. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_t*
|
|
|
|
trx_allocate_for_background(void);
|
|
|
|
/*=============================*/
|
|
|
|
/* out, own: transaction object */
|
|
|
|
/************************************************************************
|
|
|
|
Frees a transaction object. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_free(
|
|
|
|
/*=====*/
|
|
|
|
trx_t* trx); /* in, own: trx object */
|
|
|
|
/************************************************************************
|
|
|
|
Frees a transaction object for MySQL. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_free_for_mysql(
|
|
|
|
/*===============*/
|
|
|
|
trx_t* trx); /* in, own: trx object */
|
|
|
|
/************************************************************************
|
|
|
|
Frees a transaction object of a background operation of the master thread. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_free_for_background(
|
|
|
|
/*====================*/
|
|
|
|
trx_t* trx); /* in, own: trx object */
|
|
|
|
/********************************************************************
|
|
|
|
Creates trx objects for transactions and initializes the trx list of
|
|
|
|
trx_sys at database start. Rollback segment and undo log lists must
|
|
|
|
already exist when this function is called, because the lists of
|
|
|
|
transactions to be rolled back or cleaned up are built based on the
|
|
|
|
undo log lists. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_lists_init_at_db_start(void);
|
|
|
|
/*============================*/
|
|
|
|
/********************************************************************
|
|
|
|
Starts a new transaction. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ibool
|
|
|
|
trx_start(
|
|
|
|
/*======*/
|
|
|
|
/* out: TRUE if success, FALSE if the rollback
|
|
|
|
segment could not support this many transactions */
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_t* trx, /* in: transaction */
|
2005-10-27 07:29:40 +00:00
|
|
|
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. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ibool
|
|
|
|
trx_start_low(
|
|
|
|
/*==========*/
|
|
|
|
/* out: TRUE */
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_t* trx, /* in: transaction */
|
2005-10-27 07:29:40 +00:00
|
|
|
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_INLINE
|
|
|
|
void
|
|
|
|
trx_start_if_not_started(
|
|
|
|
/*=====================*/
|
|
|
|
trx_t* trx); /* in: transaction */
|
|
|
|
/*****************************************************************
|
|
|
|
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 */
|
|
|
|
/********************************************************************
|
|
|
|
Commits a transaction. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_commit_off_kernel(
|
|
|
|
/*==================*/
|
|
|
|
trx_t* trx); /* in: transaction */
|
|
|
|
/********************************************************************
|
|
|
|
Cleans up a transaction at database startup. The cleanup is needed if
|
|
|
|
the transaction already got to the middle of a commit when the database
|
|
|
|
crashed, andf we cannot roll it back. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_cleanup_at_db_startup(
|
|
|
|
/*======================*/
|
|
|
|
trx_t* trx); /* in: transaction */
|
|
|
|
/**************************************************************************
|
|
|
|
Does the transaction commit for MySQL. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_commit_for_mysql(
|
|
|
|
/*=================*/
|
2007-06-21 10:42:20 +00:00
|
|
|
/* out: DB_SUCCESS or error number */
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_t* trx); /* in: trx handle */
|
|
|
|
/**************************************************************************
|
|
|
|
Does the transaction prepare for MySQL. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_prepare_for_mysql(
|
2006-02-23 19:25:29 +00:00
|
|
|
/*==================*/
|
2005-10-27 07:29:40 +00:00
|
|
|
/* out: 0 or error number */
|
|
|
|
trx_t* trx); /* in: trx handle */
|
|
|
|
/**************************************************************************
|
|
|
|
This function is used to find number of prepared transactions and
|
|
|
|
their transaction objects for a recovery. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
int
|
|
|
|
trx_recover_for_mysql(
|
|
|
|
/*==================*/
|
|
|
|
/* out: number of prepared transactions */
|
2006-02-23 19:25:29 +00:00
|
|
|
XID* xid_list, /* in/out: prepared transactions */
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint len); /* in: number of slots in xid_list */
|
|
|
|
/***********************************************************************
|
|
|
|
This function is used to find one X/Open XA distributed transaction
|
|
|
|
which is in the prepared state */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
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. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ulint
|
|
|
|
trx_commit_complete_for_mysql(
|
|
|
|
/*==========================*/
|
|
|
|
/* out: 0 or error number */
|
|
|
|
trx_t* trx); /* in: trx handle */
|
|
|
|
/**************************************************************************
|
|
|
|
Marks the latest SQL statement ended. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_mark_sql_stat_end(
|
|
|
|
/*==================*/
|
|
|
|
trx_t* trx); /* in: trx handle */
|
|
|
|
/************************************************************************
|
|
|
|
Assigns a read view for a consistent read query. All the consistent reads
|
|
|
|
within the same transaction will get the same read view, which is created
|
|
|
|
when this function is first called for a new started transaction. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
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 to
|
|
|
|
the TRX_QUE_RUNNING state and releases query threads which were
|
|
|
|
waiting for a lock in the wait_thrs list. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_end_lock_wait(
|
|
|
|
/*==============*/
|
|
|
|
trx_t* trx); /* in: transaction */
|
|
|
|
/********************************************************************
|
|
|
|
Sends a signal to a trx object. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2006-06-13 20:23:26 +00:00
|
|
|
void
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_sig_send(
|
|
|
|
/*=========*/
|
|
|
|
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 */
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_savept_t* savept, /* in: possible rollback savepoint, or
|
2005-10-27 07:29:40 +00:00
|
|
|
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 has
|
|
|
|
been handled. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_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. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_sig_remove(
|
|
|
|
/*===========*/
|
|
|
|
trx_t* trx, /* in: trx handle */
|
|
|
|
trx_sig_t* sig); /* in, own: signal */
|
|
|
|
/********************************************************************
|
|
|
|
Starts handling of a trx signal. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_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, and
|
|
|
|
trx->graph_before_signal_handling != NULL, returns control to the error
|
|
|
|
handling routine of the graph (currently only returns the control to the
|
|
|
|
graph root which then sends an error message to the client). */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_end_signal_handling(
|
|
|
|
/*====================*/
|
|
|
|
trx_t* trx); /* in: trx */
|
|
|
|
/*************************************************************************
|
|
|
|
Creates a commit command node struct. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
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. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
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 the
|
|
|
|
kernel mutex and must have called
|
|
|
|
innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL
|
|
|
|
or InnoDB cannot meanwhile change the info printed here. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
void
|
|
|
|
trx_print(
|
|
|
|
/*======*/
|
|
|
|
FILE* f, /* in: output stream */
|
|
|
|
trx_t* trx, /* in: transaction */
|
2006-02-23 19:25:29 +00:00
|
|
|
ulint max_query_len); /* in: max query length to print, or 0 to
|
2005-10-27 07:29:40 +00:00
|
|
|
use the default max length */
|
|
|
|
|
2007-10-19 10:52:25 +00:00
|
|
|
/** Type of data dictionary operation */
|
|
|
|
enum trx_dict_op {
|
|
|
|
/** The transaction is not modifying the data dictionary. */
|
|
|
|
TRX_DICT_OP_NONE = 0,
|
|
|
|
/** The transaction is creating a table or an index, or
|
|
|
|
dropping a table. The table must be dropped in crash
|
|
|
|
recovery. This and TRX_DICT_OP_NONE are the only possible
|
|
|
|
operation modes in crash recovery. */
|
|
|
|
TRX_DICT_OP_TABLE = 1,
|
2007-11-29 10:34:55 +00:00
|
|
|
/** The transaction is creating or dropping an index in an
|
|
|
|
existing table. In crash recovery, the the data dictionary
|
|
|
|
must be locked, but the table must not be dropped. */
|
2008-01-25 14:26:07 +00:00
|
|
|
TRX_DICT_OP_INDEX = 2
|
2007-10-19 10:52:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
Determine if a transaction is a dictionary operation. */
|
|
|
|
UNIV_INLINE
|
|
|
|
enum trx_dict_op
|
|
|
|
trx_get_dict_operation(
|
|
|
|
/*===================*/
|
|
|
|
/* out: dictionary operation mode */
|
|
|
|
const trx_t* trx) /* in: transaction */
|
|
|
|
__attribute__((pure));
|
|
|
|
/**************************************************************************
|
|
|
|
Flag a transaction a dictionary operation. */
|
|
|
|
UNIV_INLINE
|
|
|
|
void
|
|
|
|
trx_set_dict_operation(
|
|
|
|
/*===================*/
|
|
|
|
trx_t* trx, /* in/out: transaction */
|
|
|
|
enum trx_dict_op op); /* in: operation, not
|
|
|
|
TRX_DICT_OP_NONE */
|
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
#ifndef UNIV_HOTBACKUP
|
|
|
|
/**************************************************************************
|
|
|
|
Determines if the currently running transaction has been interrupted. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2005-10-27 07:29:40 +00:00
|
|
|
ibool
|
|
|
|
trx_is_interrupted(
|
|
|
|
/*===============*/
|
|
|
|
/* out: TRUE if interrupted */
|
|
|
|
trx_t* trx); /* in: transaction */
|
|
|
|
#else /* !UNIV_HOTBACKUP */
|
|
|
|
#define trx_is_interrupted(trx) FALSE
|
|
|
|
#endif /* !UNIV_HOTBACKUP */
|
|
|
|
|
2007-05-29 08:48:16 +00:00
|
|
|
/***********************************************************************
|
2007-11-28 07:07:23 +00:00
|
|
|
Calculates the "weight" of a transaction. The weight of one transaction
|
|
|
|
is estimated as the number of altered rows + the number of locked rows.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define TRX_WEIGHT(t) \
|
|
|
|
ut_dulint_add((t)->undo_no, UT_LIST_GET_LEN((t)->trx_locks))
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
Compares the "weight" (or size) of two transactions. Transactions that
|
|
|
|
have edited non-transactional tables are considered heavier than ones
|
|
|
|
that have not. */
|
2008-02-18 18:38:33 +00:00
|
|
|
UNIV_INTERN
|
2007-05-29 08:48:16 +00:00
|
|
|
int
|
|
|
|
trx_weight_cmp(
|
|
|
|
/*===========*/
|
2007-08-01 08:01:47 +00:00
|
|
|
/* out: <0, 0 or >0; similar to strcmp(3) */
|
|
|
|
const trx_t* a, /* in: the first transaction to be compared */
|
|
|
|
const trx_t* b); /* in: the second transaction to be compared */
|
2005-10-27 07:29:40 +00:00
|
|
|
|
2007-08-23 09:29:28 +00:00
|
|
|
/***********************************************************************
|
|
|
|
Retrieves transacion's id, represented as unsigned long long. */
|
|
|
|
UNIV_INLINE
|
|
|
|
ullint
|
|
|
|
trx_get_id(
|
|
|
|
/*=======*/
|
|
|
|
/* out: transaction's id */
|
|
|
|
const trx_t* trx); /* in: transaction */
|
|
|
|
|
|
|
|
/* Maximum length of a string that can be returned by
|
|
|
|
trx_get_que_state_str(). */
|
|
|
|
#define TRX_QUE_STATE_STR_MAX_LEN 12 /* "ROLLING BACK" */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
Retrieves transaction's que state in a human readable string. The string
|
|
|
|
should not be free()'d or modified. */
|
|
|
|
UNIV_INLINE
|
|
|
|
const char*
|
|
|
|
trx_get_que_state_str(
|
|
|
|
/*==================*/
|
|
|
|
/* out: string in the data segment */
|
|
|
|
const trx_t* trx); /* in: transaction */
|
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
/* Signal to a transaction */
|
|
|
|
struct trx_sig_struct{
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned type:3; /* signal type */
|
|
|
|
unsigned sender:1; /* TRX_SIG_SELF or
|
2005-10-27 07:29:40 +00:00
|
|
|
TRX_SIG_OTHER_SESS */
|
|
|
|
que_thr_t* receiver; /* non-NULL if the sender of the signal
|
|
|
|
wants reply after the operation induced
|
|
|
|
by the signal is completed */
|
|
|
|
trx_savept_t savept; /* possible rollback savepoint */
|
|
|
|
UT_LIST_NODE_T(trx_sig_t)
|
|
|
|
signals; /* queue of pending signals to the
|
|
|
|
transaction */
|
|
|
|
UT_LIST_NODE_T(trx_sig_t)
|
|
|
|
reply_signals; /* list of signals for which the sender
|
|
|
|
transaction is waiting a reply */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TRX_MAGIC_N 91118598
|
|
|
|
|
|
|
|
/* The transaction handle; every session has a trx object which is freed only
|
|
|
|
when the session is freed; in addition there may be session-less transactions
|
|
|
|
rolling back after a database recovery */
|
|
|
|
|
|
|
|
struct trx_struct{
|
|
|
|
ulint magic_n;
|
|
|
|
/* All the next fields are protected by the kernel mutex, except the
|
|
|
|
undo logs which are protected by undo_mutex */
|
|
|
|
const char* op_info; /* English text describing the
|
|
|
|
current operation, or an empty
|
|
|
|
string */
|
2007-04-02 05:39:41 +00:00
|
|
|
unsigned is_purge:1; /* 0=user transaction, 1=purge */
|
2007-10-29 15:32:19 +00:00
|
|
|
unsigned is_recovered:1; /* 0=normal transaction,
|
|
|
|
1=recovered, must be rolled back */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned conc_state:2; /* state of the trx from the point
|
2005-10-27 07:29:40 +00:00
|
|
|
of view of concurrency control:
|
|
|
|
TRX_ACTIVE, TRX_COMMITTED_IN_MEMORY,
|
|
|
|
... */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned que_state:2; /* valid when conc_state == TRX_ACTIVE:
|
|
|
|
TRX_QUE_RUNNING, TRX_QUE_LOCK_WAIT,
|
|
|
|
... */
|
|
|
|
unsigned isolation_level:2;/* TRX_ISO_REPEATABLE_READ, ... */
|
|
|
|
unsigned check_foreigns:1;/* normally TRUE, but if the user
|
2005-10-27 07:29:40 +00:00
|
|
|
wants to suppress foreign key checks,
|
|
|
|
(in table imports, for example) we
|
|
|
|
set this FALSE */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned check_unique_secondary:1;
|
2005-10-27 07:29:40 +00:00
|
|
|
/* normally TRUE, but if the user
|
|
|
|
wants to speed up inserts by
|
|
|
|
suppressing unique key checks
|
|
|
|
for secondary indexes when we decide
|
|
|
|
if we can use the insert buffer for
|
|
|
|
them, we set this FALSE */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned support_xa:1; /* normally we do the XA two-phase
|
2005-10-27 07:29:40 +00:00
|
|
|
commit steps, but by setting this to
|
|
|
|
FALSE, one can save CPU time and about
|
|
|
|
150 bytes in the undo log size as then
|
|
|
|
we skip XA steps */
|
2009-01-14 07:52:06 +00:00
|
|
|
unsigned flush_log_later:1;/* In 2PC, we hold the
|
|
|
|
prepare_commit mutex across
|
|
|
|
both phases. In that case, we
|
|
|
|
defer flush of the logs to disk
|
|
|
|
until after we release the
|
|
|
|
mutex. */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned must_flush_log_later:1;/* this flag is set to TRUE in
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_commit_off_kernel() if
|
|
|
|
flush_log_later was TRUE, and there
|
|
|
|
were modifications by the transaction;
|
|
|
|
in that case we must flush the log
|
|
|
|
in trx_commit_complete_for_mysql() */
|
2007-10-19 10:52:25 +00:00
|
|
|
unsigned dict_operation:2;/**< @see enum trx_dict_op */
|
2007-05-14 09:07:15 +00:00
|
|
|
unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */
|
|
|
|
unsigned active_trans:2; /* 1 - if a transaction in MySQL
|
2005-10-27 07:29:40 +00:00
|
|
|
is active. 2 - if prepare_commit_mutex
|
2006-02-23 19:25:29 +00:00
|
|
|
was taken */
|
2007-09-05 10:18:03 +00:00
|
|
|
unsigned has_search_latch:1;
|
|
|
|
/* TRUE if this trx has latched the
|
|
|
|
search system latch in S-mode */
|
|
|
|
unsigned declared_to_be_inside_innodb:1;
|
|
|
|
/* this is TRUE if we have declared
|
|
|
|
this transaction in
|
|
|
|
srv_conc_enter_innodb to be inside the
|
|
|
|
InnoDB engine */
|
|
|
|
unsigned handling_signals:1;/* this is TRUE as long as the trx
|
|
|
|
is handling signals */
|
|
|
|
unsigned dict_operation_lock_mode:2;
|
|
|
|
/* 0, RW_S_LATCH, or RW_X_LATCH:
|
|
|
|
the latch mode trx currently holds
|
|
|
|
on dict_operation_lock */
|
|
|
|
time_t start_time; /* time the trx object was created
|
|
|
|
or the state last time became
|
|
|
|
TRX_ACTIVE */
|
|
|
|
dulint id; /* transaction id */
|
|
|
|
XID xid; /* X/Open XA transaction
|
|
|
|
identification to identify a
|
|
|
|
transaction branch */
|
|
|
|
dulint no; /* transaction serialization number ==
|
|
|
|
max trx id when the transaction is
|
|
|
|
moved to COMMITTED_IN_MEMORY state */
|
|
|
|
ib_uint64_t commit_lsn; /* lsn at the time of the commit */
|
|
|
|
dulint table_id; /* Table to drop iff dict_operation
|
|
|
|
is TRUE, or ut_dulint_zero. */
|
|
|
|
/*------------------------------*/
|
2006-02-23 19:25:29 +00:00
|
|
|
void* mysql_thd; /* MySQL thread handle corresponding
|
2005-10-27 07:29:40 +00:00
|
|
|
to this trx, or NULL */
|
|
|
|
char** mysql_query_str;/* pointer to the field in mysqld_thd
|
|
|
|
which contains the pointer to the
|
|
|
|
current SQL query string */
|
|
|
|
const char* mysql_log_file_name;
|
|
|
|
/* if MySQL binlog is used, this field
|
|
|
|
contains a pointer to the latest file
|
|
|
|
name; this is NULL if binlog is not
|
|
|
|
used */
|
2008-05-14 15:43:19 +00:00
|
|
|
ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field
|
2005-10-27 07:29:40 +00:00
|
|
|
contains the end offset of the binlog
|
|
|
|
entry */
|
|
|
|
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
|
|
|
|
with this transaction object */
|
|
|
|
ulint mysql_process_no;/* since in Linux, 'top' reports
|
|
|
|
process id's and not thread id's, we
|
|
|
|
store the process number too */
|
|
|
|
/*------------------------------*/
|
|
|
|
ulint n_mysql_tables_in_use; /* number of Innobase tables
|
|
|
|
used in the processing of the current
|
|
|
|
SQL statement in MySQL */
|
2006-02-23 19:25:29 +00:00
|
|
|
ulint mysql_n_tables_locked;
|
|
|
|
/* how many tables the current SQL
|
2005-10-27 07:29:40 +00:00
|
|
|
statement uses, except those
|
|
|
|
in consistent read */
|
|
|
|
ulint search_latch_timeout;
|
|
|
|
/* If we notice that someone is
|
|
|
|
waiting for our S-lock on the search
|
|
|
|
latch to be released, we wait in
|
|
|
|
row0sel.c for BTR_SEA_TIMEOUT new
|
|
|
|
searches until we try to keep
|
|
|
|
the search latch again over
|
|
|
|
calls from MySQL; this is intended
|
|
|
|
to reduce contention on the search
|
|
|
|
latch */
|
|
|
|
/*------------------------------*/
|
|
|
|
ulint n_tickets_to_enter_innodb;
|
|
|
|
/* this can be > 0 only when
|
|
|
|
declared_to_... is TRUE; when we come
|
|
|
|
to srv_conc_innodb_enter, if the value
|
2006-02-23 19:25:29 +00:00
|
|
|
here is > 0, we decrement this by 1 */
|
2005-10-27 07:29:40 +00:00
|
|
|
/*------------------------------*/
|
|
|
|
dict_index_t* new_rec_locks[2];/* these are normally NULL; if
|
2006-04-12 09:32:17 +00:00
|
|
|
srv_locks_unsafe_for_binlog is TRUE
|
|
|
|
or session is using READ COMMITTED
|
|
|
|
isolation level,
|
2005-10-27 07:29:40 +00:00
|
|
|
in a cursor search, if we set a new
|
|
|
|
record lock on an index, this is set
|
|
|
|
to point to the index; this is
|
|
|
|
used in releasing the locks under the
|
|
|
|
cursors if we are performing an UPDATE
|
|
|
|
and we determine after retrieving
|
|
|
|
the row that it does not need to be
|
|
|
|
locked; thus, these can be used to
|
|
|
|
implement a 'mini-rollback' that
|
|
|
|
releases the latest record locks */
|
|
|
|
UT_LIST_NODE_T(trx_t)
|
|
|
|
trx_list; /* list of transactions */
|
|
|
|
UT_LIST_NODE_T(trx_t)
|
|
|
|
mysql_trx_list; /* list of transactions created for
|
|
|
|
MySQL */
|
|
|
|
/*------------------------------*/
|
|
|
|
ulint error_state; /* 0 if no error, otherwise error
|
|
|
|
number; NOTE That ONLY the thread
|
|
|
|
doing the transaction is allowed to
|
|
|
|
set this field: this is NOT protected
|
|
|
|
by the kernel mutex */
|
2007-08-15 06:53:34 +00:00
|
|
|
const dict_index_t*error_info; /* if the error number indicates a
|
2005-10-27 07:29:40 +00:00
|
|
|
duplicate key error, a pointer to
|
|
|
|
the problematic index is stored here */
|
2007-04-04 11:05:33 +00:00
|
|
|
ulint error_key_num; /* if the index creation fails to a
|
|
|
|
duplicate key error, a mysql key
|
|
|
|
number of that index is stored here */
|
2005-10-27 07:29:40 +00:00
|
|
|
sess_t* sess; /* session of the trx, NULL if none */
|
|
|
|
que_t* graph; /* query currently run in the session,
|
|
|
|
or NULL if none; NOTE that the query
|
|
|
|
belongs to the session, and it can
|
|
|
|
survive over a transaction commit, if
|
|
|
|
it is a stored procedure with a COMMIT
|
|
|
|
WORK statement, for instance */
|
|
|
|
ulint n_active_thrs; /* number of active query threads */
|
|
|
|
que_t* graph_before_signal_handling;
|
|
|
|
/* value of graph when signal handling
|
|
|
|
for this trx started: this is used to
|
|
|
|
return control to the original query
|
|
|
|
graph for error processing */
|
|
|
|
trx_sig_t sig; /* one signal object can be allocated
|
|
|
|
in this space, avoiding mem_alloc */
|
|
|
|
UT_LIST_BASE_NODE_T(trx_sig_t)
|
|
|
|
signals; /* queue of processed or pending
|
|
|
|
signals to the trx */
|
|
|
|
UT_LIST_BASE_NODE_T(trx_sig_t)
|
|
|
|
reply_signals; /* list of signals sent by the query
|
|
|
|
threads of this trx for which a thread
|
|
|
|
is waiting for a reply; if this trx is
|
|
|
|
killed, the reply requests in the list
|
|
|
|
must be canceled */
|
|
|
|
/*------------------------------*/
|
|
|
|
lock_t* wait_lock; /* if trx execution state is
|
|
|
|
TRX_QUE_LOCK_WAIT, this points to
|
|
|
|
the lock request, otherwise this is
|
|
|
|
NULL */
|
|
|
|
ibool was_chosen_as_deadlock_victim;
|
|
|
|
/* when the transaction decides to wait
|
2007-05-14 09:07:15 +00:00
|
|
|
for a lock, it sets this to FALSE;
|
2005-10-27 07:29:40 +00:00
|
|
|
if another transaction chooses this
|
|
|
|
transaction as a victim in deadlock
|
|
|
|
resolution, it sets this to TRUE */
|
2006-02-23 19:25:29 +00:00
|
|
|
time_t wait_started; /* lock wait started at this time */
|
2005-10-27 07:29:40 +00:00
|
|
|
UT_LIST_BASE_NODE_T(que_thr_t)
|
|
|
|
wait_thrs; /* query threads belonging to this
|
|
|
|
trx that are in the QUE_THR_LOCK_WAIT
|
|
|
|
state */
|
|
|
|
ulint deadlock_mark; /* a mark field used in deadlock
|
2007-09-05 10:18:03 +00:00
|
|
|
checking algorithm. This must be
|
|
|
|
in its own machine word, because
|
|
|
|
it can be changed by other
|
|
|
|
threads while holding kernel_mutex. */
|
2005-10-27 07:29:40 +00:00
|
|
|
/*------------------------------*/
|
|
|
|
mem_heap_t* lock_heap; /* memory heap for the locks of the
|
|
|
|
transaction */
|
2006-02-23 19:25:29 +00:00
|
|
|
UT_LIST_BASE_NODE_T(lock_t)
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_locks; /* locks reserved by the transaction */
|
|
|
|
/*------------------------------*/
|
2006-02-23 19:25:29 +00:00
|
|
|
mem_heap_t* global_read_view_heap;
|
|
|
|
/* memory heap for the global read
|
2005-10-27 07:29:40 +00:00
|
|
|
view */
|
|
|
|
read_view_t* global_read_view;
|
|
|
|
/* consistent read view associated
|
|
|
|
to a transaction or NULL */
|
|
|
|
read_view_t* read_view; /* consistent read view used in the
|
|
|
|
transaction or NULL, this read view
|
2006-02-23 19:25:29 +00:00
|
|
|
if defined can be normal read view
|
|
|
|
associated to a transaction (i.e.
|
2005-10-27 07:29:40 +00:00
|
|
|
same as global_read_view) or read view
|
|
|
|
associated to a cursor */
|
|
|
|
/*------------------------------*/
|
2006-02-23 19:25:29 +00:00
|
|
|
UT_LIST_BASE_NODE_T(trx_named_savept_t)
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_savepoints; /* savepoints set with SAVEPOINT ...,
|
|
|
|
oldest first */
|
|
|
|
/*------------------------------*/
|
|
|
|
mutex_t undo_mutex; /* mutex protecting the fields in this
|
|
|
|
section (down to undo_no_arr), EXCEPT
|
|
|
|
last_sql_stat_start, which can be
|
|
|
|
accessed only when we know that there
|
|
|
|
cannot be any activity in the undo
|
|
|
|
logs! */
|
|
|
|
dulint undo_no; /* next undo log record number to
|
2007-05-14 09:07:15 +00:00
|
|
|
assign; since the undo log is
|
|
|
|
private for a transaction, this
|
|
|
|
is a simple ascending sequence
|
|
|
|
with no gaps; thus it represents
|
|
|
|
the number of modified/inserted
|
|
|
|
rows in a transaction */
|
2005-10-27 07:29:40 +00:00
|
|
|
trx_savept_t last_sql_stat_start;
|
|
|
|
/* undo_no when the last sql statement
|
|
|
|
was started: in case of an error, trx
|
|
|
|
is rolled back down to this undo
|
|
|
|
number; see note at undo_mutex! */
|
|
|
|
trx_rseg_t* rseg; /* rollback segment assigned to the
|
|
|
|
transaction, or NULL if not assigned
|
|
|
|
yet */
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_undo_t* insert_undo; /* pointer to the insert undo log, or
|
2005-10-27 07:29:40 +00:00
|
|
|
NULL if no inserts performed yet */
|
2006-02-23 19:25:29 +00:00
|
|
|
trx_undo_t* update_undo; /* pointer to the update undo log, or
|
2005-10-27 07:29:40 +00:00
|
|
|
NULL if no update performed yet */
|
|
|
|
dulint roll_limit; /* least undo number to undo during
|
|
|
|
a rollback */
|
|
|
|
ulint pages_undone; /* number of undo log pages undone
|
|
|
|
since the last undo log truncation */
|
|
|
|
trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log
|
|
|
|
records which are currently processed
|
|
|
|
by a rollback operation */
|
branches/innodb+: Merge revisions 2867:2986 from branches/zip:
------------------------------------------------------------------------
r2867 | marko | 2008-10-24 10:24:17 +0300 (Fri, 24 Oct 2008) | 2 lines
branches/zip: ChangeLog: Document r2763, r2794, r2683, r2799, r2809, r2866.
------------------------------------------------------------------------
r2869 | vasil | 2008-10-24 11:14:16 +0300 (Fri, 24 Oct 2008) | 4 lines
branches/zip:
White space cleanup in ChangeLog
------------------------------------------------------------------------
r2870 | vasil | 2008-10-24 13:36:14 +0300 (Fri, 24 Oct 2008) | 8 lines
branches/zip:
Remove a statement that causes the innodb-index test to fail.
The change in behavior was introduced in MySQL BZR-r2738.
Suggested by: Marko
------------------------------------------------------------------------
r2871 | vasil | 2008-10-24 13:48:38 +0300 (Fri, 24 Oct 2008) | 5 lines
branches/zip:
Adjust mysql-test/patches/innodb-index.diff after the change to
mysql-test/innodb-index.(test|result) in r2870.
------------------------------------------------------------------------
r2878 | calvin | 2008-10-27 11:05:42 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: port the fix of Bug#19424 - InnoDB: Possibly a memory
overrun of the buffer being freed with 64-bit Microsoft Visual C++.
The changed file:
CMakeLists.txt: Removing Win64 compiler optimizations for all
innodb/mem/* files.
------------------------------------------------------------------------
r2884 | vasil | 2008-10-27 11:48:46 +0200 (Mon, 27 Oct 2008) | 7 lines
branches/zip:
ChangeLog:
Add entry for the fix of Bug#19424 InnoDB: Possibly a memory overrun of
the buffer being freed (64-bit Visual C)
------------------------------------------------------------------------
r2886 | calvin | 2008-10-27 22:39:11 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: This patch is to solve the issue that file handles can
not cross DLL/EXE boundaries on Windows. In builtin InnoDB, it makes
call to MySQL server for creating tmp files. innobase_mysql_tmpfile
is now rewritten for the plugin.
rb://5
Approved by: Marko
------------------------------------------------------------------------
r2887 | calvin | 2008-10-27 22:48:29 +0200 (Mon, 27 Oct 2008) | 44 lines
branches/zip: implement the delayloading of externals for the plugin
on Windows, which includes:
* Load mysqld.map and insert all symbol/address pairs into hash for
quick access
* Resolves all external data variables. The delayloading mechanism
in MSVC does not support automatic imports of data variables.
A workaround is to explicitly handle the data import using the delay
loader during the initialization of the plugin.
* Resolves all external functions during run-time, by implementing
the delayed loading helper function delayLoadHelper2, which is
called by run-time as well as HrLoadAllImportsForDll.
The delay loader reuses the hash implementation in InnoDB. The normal
hash_create (in hash0hash.c) creates hash tables in buffer pool. But
the delay loader is invoked before the engine is initialized, and
buffer pools are not ready yet. Instead, the delay loader has its own
implementation of hash_create() and hash_table_free(), called
wdl_hash_create() and wdl_hash_table_free().
This patch should be used with other two patches in order to build
a dynamically linked plugin on Windows:
* patch for tmpfile functions (r2886)
* patch for "build" files (to be committed)
The list of file changed:
handler/handler0vars.h: new file, defines a list of external data
variables (no external functions).
handler/win_delay_loader.cc: new file, the implementation of the delay
loader for Windows plugin.
handler/ha_innodb.cc: add a header file, and changes for copying the
system variables.
handler/handler0alter.cc: add a header file
handler/i_s.cc: add a header file
rb://27
Reviewed by: Sunny, Marko
Approved by: Sunny
------------------------------------------------------------------------
r2888 | calvin | 2008-10-28 01:51:49 +0200 (Tue, 28 Oct 2008) | 25 lines
branches/zip: for building dynamic plugin on Windows, ha_innodb.dll,
when INNODB_DYNAMIC_PLUGIN is specified.
The changes are:
CMakeLists.txt: add project ha_innodb for dynamic plugin on Windows.
ha_innodb depends on project mysqld.
ha_innodb.def: a new file with standard exports for a dynamic plugin.
Two new files will be added:
* sql/mysqld.def: .def file for 32-bit compiler
* sql/mysqld_x64.def: .def file for x64 compiler
It is also required to apply a patch to the MySQL source tree. The
patch is described in win-plugin/README:
win-plugin/win-plugin.diff - a patch to be applied to MySQL source
tree. When applied, the following files will be modified:
* CMakeLists.txt: add INNODB_DYNAMIC_PLUGIN and _USE_32BIT_TIME_T
* sql/CMakeLists.txt: add mysqld.def or mysqld_x64.def for mysqld
* win/configure.js: add INNODB_DYNAMIC_PLUGIN
* win/build-vs71.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8_x64.bat: provide an option to specify CMAKE_BUILD_TYPE
------------------------------------------------------------------------
r2894 | marko | 2008-10-28 08:36:39 +0200 (Tue, 28 Oct 2008) | 4 lines
branches/zip: dict_str_starts_with_keyword(): Removed this unused function.
Spotted by Sunny.
------------------------------------------------------------------------
r2895 | vasil | 2008-10-28 08:40:45 +0200 (Tue, 28 Oct 2008) | 6 lines
branches/zip:
ChangeLog:
add entry for the Windows plugin.
------------------------------------------------------------------------
r2917 | marko | 2008-10-28 23:53:23 +0200 (Tue, 28 Oct 2008) | 3 lines
branches/zip: innodb_plugin_init(): Do not copy session variables,
even when the variable is a global variable in the built-in InnoDB.
------------------------------------------------------------------------
r2918 | calvin | 2008-10-29 00:08:11 +0200 (Wed, 29 Oct 2008) | 2 lines
branches/zip: fix a problem introduced in r2917 - dyn is not
initialized. Move the check into for().
------------------------------------------------------------------------
r2922 | calvin | 2008-10-29 08:29:01 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: fix issue #102 - Windows plugin: resolve dbug functions
during run-time.
Implement wrapper functions in the plugin. The plugin will get the
function entries from mysqld.exe during the init, and invoke the
corresponding functions (in mysqld.exe). The list of functions are:
_db_pargs_
_db_doprnt_
_db_enter_
_db_return_
_db_dump_
rb://38
Approved by: Marko
------------------------------------------------------------------------
r2923 | marko | 2008-10-29 09:52:30 +0200 (Wed, 29 Oct 2008) | 1 line
branches/zip: ChangeLog: Mention Bug #27276.
------------------------------------------------------------------------
r2925 | calvin | 2008-10-29 10:09:41 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: change function names in sql/mysqld.def in order
to work with 5.1.29-rc.
In 5.1.29, the following function names are changed:
_hash_init
hash_free
hash_search
hash_delete
changed to
_my_hash_init
my_hash_free
my_hash_search
my_hash_delete
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2927 | marko | 2008-10-29 11:43:23 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip: ha_innodb.cc: Make some functions static, so that they will
not be compiled as weak global symbols. These functions must not be
redirected to the built-in InnoDB.
------------------------------------------------------------------------
r2928 | michael | 2008-10-29 19:20:10 +0200 (Wed, 29 Oct 2008) | 4 lines
Remove unnecessary assert
Approved by: Heikki, over IM
------------------------------------------------------------------------
r2930 | marko | 2008-10-29 21:39:24 +0200 (Wed, 29 Oct 2008) | 33 lines
branches/zip: Merge revisions 2854:2929 from branches/5.1,
except r2924, which was merged from branches/zip r2866 to branches/5.1
and except r2879 which was merged separately by Calvin:
------------------------------------------------------------------------
r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines
branches/5.1:
Fix Bug#38189 innodb_stats_on_metadata missing
Make the variable innodb_stats_on_metadata visible to the users and
also settable at runtime. Previously it was only "visible" as a command
line startup option to mysqld.
Approved by: Marko (https://svn.innodb.com/rb/r/36)
------------------------------------------------------------------------
r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines
branches/5.1: dtype_get_sql_null_size(): return the correct storage
size of a SQL NULL column. (Bug #40369)
When MySQL Bug #20877 was fixed in r834, this function was
accidentally modified to return 0 or 1. Apparently, the only impact of
this bug is that fixed-length columns cannot be updated in-place from
or to SQL NULL, even in ROW_FORMAT=REDUNDANT. After this fix,
fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant
storage size as they should, no matter if NULL or non-NULL. The bug
caused fixed-length NULL columns to occupy 1 byte.
rb://37 approved by Heikki over IM.
------------------------------------------------------------------------
------------------------------------------------------------------------
r2931 | vasil | 2008-10-29 22:10:40 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip:
Add 2 ChangeLog entries for the 2 bugfixes that were merged from branches/5.1.
------------------------------------------------------------------------
r2935 | vasil | 2008-10-30 12:17:23 +0200 (Thu, 30 Oct 2008) | 17 lines
branches/zip:
Fix "Bug#40360 Binlog related errors with binlog off" in InnoDB code in order
to have a Bug#40360-free InnoDB Plugin 1.0.2.
The fix does check whether binary logging is enabled in MySQL by accessing the
opt_bin_log global variable that is defined in sql/mysqld.cc.
In case MySQL does develop another solution to this via Bug#40360 then we can
revert this patch (except the mysql-tests).
The windows-plugin part of this fix will be committed as a separate commit to
ease eventual merge into branches/5.1 [note from the future: the separate
commit went into r2936].
Approved by: Marko (https://svn.innodb.com/rb/r/39)
------------------------------------------------------------------------
r2936 | vasil | 2008-10-30 12:24:09 +0200 (Thu, 30 Oct 2008) | 7 lines
branches/zip:
Followup to r2935: add the Windows Delay Loader stuff for the MySQL
variable that we are accessing. If someday we have another solution for
Bug#40360 Binlog related errors with binlog off
then this should also be reverted.
------------------------------------------------------------------------
r2937 | vasil | 2008-10-30 12:28:47 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Add ChangeLog entry for Bug#40360 Binlog related errors with binlog off
------------------------------------------------------------------------
r2938 | vasil | 2008-10-30 12:33:28 +0200 (Thu, 30 Oct 2008) | 5 lines
branches/zip:
Non-functional change: convert handler/handler0vars.h and
handler/win_delay_loader.cc from \r\n (dos) to \n (unix) line terminators.
------------------------------------------------------------------------
r2939 | marko | 2008-10-30 12:38:18 +0200 (Thu, 30 Oct 2008) | 2 lines
branches/zip: Set svn:eol-style native on some recently added text files.
------------------------------------------------------------------------
r2940 | marko | 2008-10-30 12:46:21 +0200 (Thu, 30 Oct 2008) | 1 line
branches/zip: ChangeLog, ha_innodb.def: Set svn:eol-style native
------------------------------------------------------------------------
r2941 | vasil | 2008-10-30 19:34:27 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Increment the InnoDB Plugin version from 1.0.1 to 1.0.2.
------------------------------------------------------------------------
r2943 | sunny | 2008-10-31 09:40:29 +0200 (Fri, 31 Oct 2008) | 15 lines
branches/zip:
1. We add a vector of locks to trx_t. This array contains the autoinc
locks granted to a transaction. There is one per table.
2. We enforce releasing of these locks in the reverse order from the
one in which they are acquired. The assumption is that since the
AUTOINC locks are statement level locks. Nested statements introduced
by triggers are stacked it should hold.
There was some cleanup done to the vector code too by adding const and
some new functions. Rename dict_table_t::auto_inc_lock to autoinc_lock.
Fix Bug#26316 Triggers create duplicate entries on auto-increment columns
rb://22
------------------------------------------------------------------------
r2944 | vasil | 2008-10-31 09:44:16 +0200 (Fri, 31 Oct 2008) | 12 lines
branches/zip:
Revert our temporary fix for "Bug#40360 Binlog related errors with binlog off"
(r2935, r2936) and deploy MySQL's one, but put the function
mysql_bin_log_is_engaged() inside mysql_addons.cc instead of in mysql's log.cc
and use a different name for it so there is no collision when MySQL adds this
function in log.cc.
[note from the future: the windows part of this patch went into r2947]
Approved by: Marko (https://svn.innodb.com/rb/r/41/)
------------------------------------------------------------------------
r2945 | sunny | 2008-10-31 09:44:45 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Update ChangeLog with r2943 info.
------------------------------------------------------------------------
r2946 | marko | 2008-10-31 10:18:47 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Revert the unintended change to univ.i that was made in r2943.
------------------------------------------------------------------------
r2947 | calvin | 2008-10-31 10:38:26 +0200 (Fri, 31 Oct 2008) | 6 lines
branches/zip: Windows plugin part of r2944
r2944 has reference to mysql_bin_log.is_open(), which is new in InnoDB.
Add two new entries and remove one duplicate in mysqld.def &
mysqld_x64.def.
------------------------------------------------------------------------
r2948 | vasil | 2008-10-31 11:39:07 +0200 (Fri, 31 Oct 2008) | 9 lines
branches/zip:
Fix Mantis issue#106 plugin init error:InnoDB: stats_on_metadata in static
InnoDB (flags=0x2401) differs from stats_on_metadata in dynamic InnoDB (fl
Ignore the NOSYSVAR flag in addition to ignoring the READONLY flag.
Approved by: Marko (https://svn.innodb.com/rb/r/42/)
------------------------------------------------------------------------
r2949 | vasil | 2008-10-31 11:47:56 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip:
White-space cleanup in ChangeLog.
------------------------------------------------------------------------
r2951 | marko | 2008-10-31 14:21:43 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip: scripts/install_innodb_plugins_win.sql: New script,
for installing the InnoDB plugins in Windows. Copied from
scripts/install_innodb_plugins.sql.
------------------------------------------------------------------------
r2954 | calvin | 2008-11-04 09:15:26 +0200 (Tue, 04 Nov 2008) | 8 lines
branches/zip: ignore the failure when builtin_innobase_plugin is not
available.
External variable builtin_innobase_plugin is not available when mysqld
does not have a builtin InnoDB. The init of the Windows plugin should
not fail in this case.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2955 | calvin | 2008-11-04 12:43:14 +0200 (Tue, 04 Nov 2008) | 11 lines
branches/zip: windows plugin - fix references to array variables.
This problem surfaced when running new test innodb_bug40360.test. Both
tx_isolation_names and binlog_format_names are name arrays, and
should be defined as wdl_tx_isolation_names and wdl_binlog_format_names,
not *wdl_tx_isolation_names and *wdl_binlog_format_names.
Another array variable is all_charsets, which is already correctly
defined.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2986 | marko | 2008-11-11 09:28:37 +0200 (Tue, 11 Nov 2008) | 11 lines
branches/zip: ha_innobase::create(): Remove the dependences on
DICT_TF_ZSSIZE_MAX, so that the code can be compiled with a different
uncompressed page size by redefining UNIV_PAGE_SIZE_SHIFT in univ.i.
Currently, the allowed values are 12, 13, or 14 (4k, 8k, 16k).
Make the default compressed page size half the uncompressed page size.
The previous default was 8 kilobytes, which is the same when compiling
with the default 16k uncompressed page size.
rb://50 approved by Pekka Lampio and Sunny Bains.
------------------------------------------------------------------------
2008-11-11 10:21:16 +00:00
|
|
|
/*------------------------------*/
|
2007-08-01 11:18:43 +00:00
|
|
|
ulint n_autoinc_rows; /* no. of AUTO-INC rows required for
|
|
|
|
an SQL statement. This is useful for
|
|
|
|
multi-row INSERTs */
|
branches/innodb+: Merge revisions 2867:2986 from branches/zip:
------------------------------------------------------------------------
r2867 | marko | 2008-10-24 10:24:17 +0300 (Fri, 24 Oct 2008) | 2 lines
branches/zip: ChangeLog: Document r2763, r2794, r2683, r2799, r2809, r2866.
------------------------------------------------------------------------
r2869 | vasil | 2008-10-24 11:14:16 +0300 (Fri, 24 Oct 2008) | 4 lines
branches/zip:
White space cleanup in ChangeLog
------------------------------------------------------------------------
r2870 | vasil | 2008-10-24 13:36:14 +0300 (Fri, 24 Oct 2008) | 8 lines
branches/zip:
Remove a statement that causes the innodb-index test to fail.
The change in behavior was introduced in MySQL BZR-r2738.
Suggested by: Marko
------------------------------------------------------------------------
r2871 | vasil | 2008-10-24 13:48:38 +0300 (Fri, 24 Oct 2008) | 5 lines
branches/zip:
Adjust mysql-test/patches/innodb-index.diff after the change to
mysql-test/innodb-index.(test|result) in r2870.
------------------------------------------------------------------------
r2878 | calvin | 2008-10-27 11:05:42 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: port the fix of Bug#19424 - InnoDB: Possibly a memory
overrun of the buffer being freed with 64-bit Microsoft Visual C++.
The changed file:
CMakeLists.txt: Removing Win64 compiler optimizations for all
innodb/mem/* files.
------------------------------------------------------------------------
r2884 | vasil | 2008-10-27 11:48:46 +0200 (Mon, 27 Oct 2008) | 7 lines
branches/zip:
ChangeLog:
Add entry for the fix of Bug#19424 InnoDB: Possibly a memory overrun of
the buffer being freed (64-bit Visual C)
------------------------------------------------------------------------
r2886 | calvin | 2008-10-27 22:39:11 +0200 (Mon, 27 Oct 2008) | 8 lines
branches/zip: This patch is to solve the issue that file handles can
not cross DLL/EXE boundaries on Windows. In builtin InnoDB, it makes
call to MySQL server for creating tmp files. innobase_mysql_tmpfile
is now rewritten for the plugin.
rb://5
Approved by: Marko
------------------------------------------------------------------------
r2887 | calvin | 2008-10-27 22:48:29 +0200 (Mon, 27 Oct 2008) | 44 lines
branches/zip: implement the delayloading of externals for the plugin
on Windows, which includes:
* Load mysqld.map and insert all symbol/address pairs into hash for
quick access
* Resolves all external data variables. The delayloading mechanism
in MSVC does not support automatic imports of data variables.
A workaround is to explicitly handle the data import using the delay
loader during the initialization of the plugin.
* Resolves all external functions during run-time, by implementing
the delayed loading helper function delayLoadHelper2, which is
called by run-time as well as HrLoadAllImportsForDll.
The delay loader reuses the hash implementation in InnoDB. The normal
hash_create (in hash0hash.c) creates hash tables in buffer pool. But
the delay loader is invoked before the engine is initialized, and
buffer pools are not ready yet. Instead, the delay loader has its own
implementation of hash_create() and hash_table_free(), called
wdl_hash_create() and wdl_hash_table_free().
This patch should be used with other two patches in order to build
a dynamically linked plugin on Windows:
* patch for tmpfile functions (r2886)
* patch for "build" files (to be committed)
The list of file changed:
handler/handler0vars.h: new file, defines a list of external data
variables (no external functions).
handler/win_delay_loader.cc: new file, the implementation of the delay
loader for Windows plugin.
handler/ha_innodb.cc: add a header file, and changes for copying the
system variables.
handler/handler0alter.cc: add a header file
handler/i_s.cc: add a header file
rb://27
Reviewed by: Sunny, Marko
Approved by: Sunny
------------------------------------------------------------------------
r2888 | calvin | 2008-10-28 01:51:49 +0200 (Tue, 28 Oct 2008) | 25 lines
branches/zip: for building dynamic plugin on Windows, ha_innodb.dll,
when INNODB_DYNAMIC_PLUGIN is specified.
The changes are:
CMakeLists.txt: add project ha_innodb for dynamic plugin on Windows.
ha_innodb depends on project mysqld.
ha_innodb.def: a new file with standard exports for a dynamic plugin.
Two new files will be added:
* sql/mysqld.def: .def file for 32-bit compiler
* sql/mysqld_x64.def: .def file for x64 compiler
It is also required to apply a patch to the MySQL source tree. The
patch is described in win-plugin/README:
win-plugin/win-plugin.diff - a patch to be applied to MySQL source
tree. When applied, the following files will be modified:
* CMakeLists.txt: add INNODB_DYNAMIC_PLUGIN and _USE_32BIT_TIME_T
* sql/CMakeLists.txt: add mysqld.def or mysqld_x64.def for mysqld
* win/configure.js: add INNODB_DYNAMIC_PLUGIN
* win/build-vs71.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8.bat: provide an option to specify CMAKE_BUILD_TYPE
* win/build-vs8_x64.bat: provide an option to specify CMAKE_BUILD_TYPE
------------------------------------------------------------------------
r2894 | marko | 2008-10-28 08:36:39 +0200 (Tue, 28 Oct 2008) | 4 lines
branches/zip: dict_str_starts_with_keyword(): Removed this unused function.
Spotted by Sunny.
------------------------------------------------------------------------
r2895 | vasil | 2008-10-28 08:40:45 +0200 (Tue, 28 Oct 2008) | 6 lines
branches/zip:
ChangeLog:
add entry for the Windows plugin.
------------------------------------------------------------------------
r2917 | marko | 2008-10-28 23:53:23 +0200 (Tue, 28 Oct 2008) | 3 lines
branches/zip: innodb_plugin_init(): Do not copy session variables,
even when the variable is a global variable in the built-in InnoDB.
------------------------------------------------------------------------
r2918 | calvin | 2008-10-29 00:08:11 +0200 (Wed, 29 Oct 2008) | 2 lines
branches/zip: fix a problem introduced in r2917 - dyn is not
initialized. Move the check into for().
------------------------------------------------------------------------
r2922 | calvin | 2008-10-29 08:29:01 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: fix issue #102 - Windows plugin: resolve dbug functions
during run-time.
Implement wrapper functions in the plugin. The plugin will get the
function entries from mysqld.exe during the init, and invoke the
corresponding functions (in mysqld.exe). The list of functions are:
_db_pargs_
_db_doprnt_
_db_enter_
_db_return_
_db_dump_
rb://38
Approved by: Marko
------------------------------------------------------------------------
r2923 | marko | 2008-10-29 09:52:30 +0200 (Wed, 29 Oct 2008) | 1 line
branches/zip: ChangeLog: Mention Bug #27276.
------------------------------------------------------------------------
r2925 | calvin | 2008-10-29 10:09:41 +0200 (Wed, 29 Oct 2008) | 16 lines
branches/zip: change function names in sql/mysqld.def in order
to work with 5.1.29-rc.
In 5.1.29, the following function names are changed:
_hash_init
hash_free
hash_search
hash_delete
changed to
_my_hash_init
my_hash_free
my_hash_search
my_hash_delete
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2927 | marko | 2008-10-29 11:43:23 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip: ha_innodb.cc: Make some functions static, so that they will
not be compiled as weak global symbols. These functions must not be
redirected to the built-in InnoDB.
------------------------------------------------------------------------
r2928 | michael | 2008-10-29 19:20:10 +0200 (Wed, 29 Oct 2008) | 4 lines
Remove unnecessary assert
Approved by: Heikki, over IM
------------------------------------------------------------------------
r2930 | marko | 2008-10-29 21:39:24 +0200 (Wed, 29 Oct 2008) | 33 lines
branches/zip: Merge revisions 2854:2929 from branches/5.1,
except r2924, which was merged from branches/zip r2866 to branches/5.1
and except r2879 which was merged separately by Calvin:
------------------------------------------------------------------------
r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines
branches/5.1:
Fix Bug#38189 innodb_stats_on_metadata missing
Make the variable innodb_stats_on_metadata visible to the users and
also settable at runtime. Previously it was only "visible" as a command
line startup option to mysqld.
Approved by: Marko (https://svn.innodb.com/rb/r/36)
------------------------------------------------------------------------
r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines
branches/5.1: dtype_get_sql_null_size(): return the correct storage
size of a SQL NULL column. (Bug #40369)
When MySQL Bug #20877 was fixed in r834, this function was
accidentally modified to return 0 or 1. Apparently, the only impact of
this bug is that fixed-length columns cannot be updated in-place from
or to SQL NULL, even in ROW_FORMAT=REDUNDANT. After this fix,
fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant
storage size as they should, no matter if NULL or non-NULL. The bug
caused fixed-length NULL columns to occupy 1 byte.
rb://37 approved by Heikki over IM.
------------------------------------------------------------------------
------------------------------------------------------------------------
r2931 | vasil | 2008-10-29 22:10:40 +0200 (Wed, 29 Oct 2008) | 4 lines
branches/zip:
Add 2 ChangeLog entries for the 2 bugfixes that were merged from branches/5.1.
------------------------------------------------------------------------
r2935 | vasil | 2008-10-30 12:17:23 +0200 (Thu, 30 Oct 2008) | 17 lines
branches/zip:
Fix "Bug#40360 Binlog related errors with binlog off" in InnoDB code in order
to have a Bug#40360-free InnoDB Plugin 1.0.2.
The fix does check whether binary logging is enabled in MySQL by accessing the
opt_bin_log global variable that is defined in sql/mysqld.cc.
In case MySQL does develop another solution to this via Bug#40360 then we can
revert this patch (except the mysql-tests).
The windows-plugin part of this fix will be committed as a separate commit to
ease eventual merge into branches/5.1 [note from the future: the separate
commit went into r2936].
Approved by: Marko (https://svn.innodb.com/rb/r/39)
------------------------------------------------------------------------
r2936 | vasil | 2008-10-30 12:24:09 +0200 (Thu, 30 Oct 2008) | 7 lines
branches/zip:
Followup to r2935: add the Windows Delay Loader stuff for the MySQL
variable that we are accessing. If someday we have another solution for
Bug#40360 Binlog related errors with binlog off
then this should also be reverted.
------------------------------------------------------------------------
r2937 | vasil | 2008-10-30 12:28:47 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Add ChangeLog entry for Bug#40360 Binlog related errors with binlog off
------------------------------------------------------------------------
r2938 | vasil | 2008-10-30 12:33:28 +0200 (Thu, 30 Oct 2008) | 5 lines
branches/zip:
Non-functional change: convert handler/handler0vars.h and
handler/win_delay_loader.cc from \r\n (dos) to \n (unix) line terminators.
------------------------------------------------------------------------
r2939 | marko | 2008-10-30 12:38:18 +0200 (Thu, 30 Oct 2008) | 2 lines
branches/zip: Set svn:eol-style native on some recently added text files.
------------------------------------------------------------------------
r2940 | marko | 2008-10-30 12:46:21 +0200 (Thu, 30 Oct 2008) | 1 line
branches/zip: ChangeLog, ha_innodb.def: Set svn:eol-style native
------------------------------------------------------------------------
r2941 | vasil | 2008-10-30 19:34:27 +0200 (Thu, 30 Oct 2008) | 4 lines
branches/zip:
Increment the InnoDB Plugin version from 1.0.1 to 1.0.2.
------------------------------------------------------------------------
r2943 | sunny | 2008-10-31 09:40:29 +0200 (Fri, 31 Oct 2008) | 15 lines
branches/zip:
1. We add a vector of locks to trx_t. This array contains the autoinc
locks granted to a transaction. There is one per table.
2. We enforce releasing of these locks in the reverse order from the
one in which they are acquired. The assumption is that since the
AUTOINC locks are statement level locks. Nested statements introduced
by triggers are stacked it should hold.
There was some cleanup done to the vector code too by adding const and
some new functions. Rename dict_table_t::auto_inc_lock to autoinc_lock.
Fix Bug#26316 Triggers create duplicate entries on auto-increment columns
rb://22
------------------------------------------------------------------------
r2944 | vasil | 2008-10-31 09:44:16 +0200 (Fri, 31 Oct 2008) | 12 lines
branches/zip:
Revert our temporary fix for "Bug#40360 Binlog related errors with binlog off"
(r2935, r2936) and deploy MySQL's one, but put the function
mysql_bin_log_is_engaged() inside mysql_addons.cc instead of in mysql's log.cc
and use a different name for it so there is no collision when MySQL adds this
function in log.cc.
[note from the future: the windows part of this patch went into r2947]
Approved by: Marko (https://svn.innodb.com/rb/r/41/)
------------------------------------------------------------------------
r2945 | sunny | 2008-10-31 09:44:45 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Update ChangeLog with r2943 info.
------------------------------------------------------------------------
r2946 | marko | 2008-10-31 10:18:47 +0200 (Fri, 31 Oct 2008) | 2 lines
branches/zip: Revert the unintended change to univ.i that was made in r2943.
------------------------------------------------------------------------
r2947 | calvin | 2008-10-31 10:38:26 +0200 (Fri, 31 Oct 2008) | 6 lines
branches/zip: Windows plugin part of r2944
r2944 has reference to mysql_bin_log.is_open(), which is new in InnoDB.
Add two new entries and remove one duplicate in mysqld.def &
mysqld_x64.def.
------------------------------------------------------------------------
r2948 | vasil | 2008-10-31 11:39:07 +0200 (Fri, 31 Oct 2008) | 9 lines
branches/zip:
Fix Mantis issue#106 plugin init error:InnoDB: stats_on_metadata in static
InnoDB (flags=0x2401) differs from stats_on_metadata in dynamic InnoDB (fl
Ignore the NOSYSVAR flag in addition to ignoring the READONLY flag.
Approved by: Marko (https://svn.innodb.com/rb/r/42/)
------------------------------------------------------------------------
r2949 | vasil | 2008-10-31 11:47:56 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip:
White-space cleanup in ChangeLog.
------------------------------------------------------------------------
r2951 | marko | 2008-10-31 14:21:43 +0200 (Fri, 31 Oct 2008) | 4 lines
branches/zip: scripts/install_innodb_plugins_win.sql: New script,
for installing the InnoDB plugins in Windows. Copied from
scripts/install_innodb_plugins.sql.
------------------------------------------------------------------------
r2954 | calvin | 2008-11-04 09:15:26 +0200 (Tue, 04 Nov 2008) | 8 lines
branches/zip: ignore the failure when builtin_innobase_plugin is not
available.
External variable builtin_innobase_plugin is not available when mysqld
does not have a builtin InnoDB. The init of the Windows plugin should
not fail in this case.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2955 | calvin | 2008-11-04 12:43:14 +0200 (Tue, 04 Nov 2008) | 11 lines
branches/zip: windows plugin - fix references to array variables.
This problem surfaced when running new test innodb_bug40360.test. Both
tx_isolation_names and binlog_format_names are name arrays, and
should be defined as wdl_tx_isolation_names and wdl_binlog_format_names,
not *wdl_tx_isolation_names and *wdl_binlog_format_names.
Another array variable is all_charsets, which is already correctly
defined.
Approved by: Marko (on IM)
------------------------------------------------------------------------
r2986 | marko | 2008-11-11 09:28:37 +0200 (Tue, 11 Nov 2008) | 11 lines
branches/zip: ha_innobase::create(): Remove the dependences on
DICT_TF_ZSSIZE_MAX, so that the code can be compiled with a different
uncompressed page size by redefining UNIV_PAGE_SIZE_SHIFT in univ.i.
Currently, the allowed values are 12, 13, or 14 (4k, 8k, 16k).
Make the default compressed page size half the uncompressed page size.
The previous default was 8 kilobytes, which is the same when compiling
with the default 16k uncompressed page size.
rb://50 approved by Pekka Lampio and Sunny Bains.
------------------------------------------------------------------------
2008-11-11 10:21:16 +00:00
|
|
|
ib_vector_t* autoinc_locks; /* AUTOINC locks held by this
|
|
|
|
transaction. Note that these are
|
|
|
|
also in the lock list trx_locks. This
|
|
|
|
vector needs to be freed explicitly
|
|
|
|
when the trx_t instance is desrtoyed */
|
2005-10-27 07:29:40 +00:00
|
|
|
/*------------------------------*/
|
|
|
|
char detailed_error[256]; /* detailed error message for last
|
|
|
|
error, or empty. */
|
|
|
|
};
|
|
|
|
|
2006-08-29 09:30:31 +00:00
|
|
|
#define TRX_MAX_N_THREADS 32 /* maximum number of
|
|
|
|
concurrent threads running a
|
|
|
|
single operation of a
|
|
|
|
transaction, e.g., a parallel
|
|
|
|
query */
|
2007-05-14 09:07:15 +00:00
|
|
|
/* Transaction concurrency states (trx->conc_state) */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_NOT_STARTED 0
|
|
|
|
#define TRX_ACTIVE 1
|
|
|
|
#define TRX_COMMITTED_IN_MEMORY 2
|
|
|
|
#define TRX_PREPARED 3 /* Support for 2PC/XA */
|
2005-10-27 07:29:40 +00:00
|
|
|
|
2007-05-14 09:07:15 +00:00
|
|
|
/* Transaction execution states when trx->conc_state == TRX_ACTIVE */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_QUE_RUNNING 0 /* transaction is running */
|
|
|
|
#define TRX_QUE_LOCK_WAIT 1 /* transaction is waiting for a lock */
|
|
|
|
#define TRX_QUE_ROLLING_BACK 2 /* transaction is rolling back */
|
|
|
|
#define TRX_QUE_COMMITTING 3 /* transaction is committing */
|
2005-10-27 07:29:40 +00:00
|
|
|
|
2007-05-14 09:07:15 +00:00
|
|
|
/* Transaction isolation levels (trx->isolation_level) */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_ISO_READ_UNCOMMITTED 0 /* dirty read: non-locking
|
2005-10-27 07:29:40 +00:00
|
|
|
SELECTs are performed so that
|
|
|
|
we do not look at a possible
|
|
|
|
earlier version of a record;
|
|
|
|
thus they are not 'consistent'
|
|
|
|
reads under this isolation
|
|
|
|
level; otherwise like level
|
|
|
|
2 */
|
|
|
|
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_ISO_READ_COMMITTED 1 /* somewhat Oracle-like
|
2005-10-27 07:29:40 +00:00
|
|
|
isolation, except that in
|
|
|
|
range UPDATE and DELETE we
|
|
|
|
must block phantom rows
|
|
|
|
with next-key locks;
|
|
|
|
SELECT ... FOR UPDATE and ...
|
|
|
|
LOCK IN SHARE MODE only lock
|
|
|
|
the index records, NOT the
|
|
|
|
gaps before them, and thus
|
|
|
|
allow free inserting;
|
|
|
|
each consistent read reads its
|
|
|
|
own snapshot */
|
|
|
|
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_ISO_REPEATABLE_READ 2 /* this is the default;
|
2005-10-27 07:29:40 +00:00
|
|
|
all consistent reads in the
|
|
|
|
same trx read the same
|
|
|
|
snapshot;
|
|
|
|
full next-key locking used
|
|
|
|
in locking reads to block
|
|
|
|
insertions into gaps */
|
|
|
|
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_ISO_SERIALIZABLE 3 /* all plain SELECTs are
|
2005-10-27 07:29:40 +00:00
|
|
|
converted to LOCK IN SHARE
|
|
|
|
MODE reads */
|
|
|
|
|
2007-05-14 09:07:15 +00:00
|
|
|
/* Treatment of duplicate values (trx->duplicates; for example, in inserts).
|
|
|
|
Multiple flags can be combined with bitwise OR. */
|
|
|
|
#define TRX_DUP_IGNORE 1 /* duplicate rows are to be updated */
|
|
|
|
#define TRX_DUP_REPLACE 2 /* duplicate rows are to be replaced */
|
|
|
|
|
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
/* Types of a trx signal */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_SIG_NO_SIGNAL 0
|
2005-10-27 07:29:40 +00:00
|
|
|
#define TRX_SIG_TOTAL_ROLLBACK 1
|
|
|
|
#define TRX_SIG_ROLLBACK_TO_SAVEPT 2
|
|
|
|
#define TRX_SIG_COMMIT 3
|
|
|
|
#define TRX_SIG_ERROR_OCCURRED 4
|
|
|
|
#define TRX_SIG_BREAK_EXECUTION 5
|
|
|
|
|
|
|
|
/* Sender types of a signal */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_SIG_SELF 0 /* sent by the session itself, or
|
2005-10-27 07:29:40 +00:00
|
|
|
by an error occurring within this
|
|
|
|
session */
|
2007-09-05 10:18:03 +00:00
|
|
|
#define TRX_SIG_OTHER_SESS 1 /* sent by another session (which
|
2005-10-27 07:29:40 +00:00
|
|
|
must hold rights to this) */
|
2006-02-23 19:25:29 +00:00
|
|
|
|
2005-10-27 07:29:40 +00:00
|
|
|
/* Commit command node in a query graph */
|
|
|
|
struct commit_node_struct{
|
|
|
|
que_common_t common; /* node type: QUE_NODE_COMMIT */
|
|
|
|
ulint state; /* node execution state */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Commit node states */
|
|
|
|
#define COMMIT_NODE_SEND 1
|
|
|
|
#define COMMIT_NODE_WAIT 2
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef UNIV_NONINL
|
|
|
|
#include "trx0trx.ic"
|
|
|
|
#endif
|
|
|
|
|
2006-02-23 19:25:29 +00:00
|
|
|
#endif
|