~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/trx0i_s.h

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
30
30
 
31
31
#include "univ.i"
32
32
#include "trx0types.h"
33
 
#include "dict0types.h"
34
33
#include "ut0ut.h"
35
34
 
36
35
/** The maximum amount of memory that can be consumed by innodb_trx,
45
44
i_s_trx_row_t::trx_query */
46
45
#define TRX_I_S_TRX_QUERY_MAX_LEN       1024
47
46
 
48
 
/** The maximum length of a string that can be stored in
49
 
i_s_trx_row_t::trx_operation_state */
50
 
#define TRX_I_S_TRX_OP_STATE_MAX_LEN    64
51
 
 
52
 
/** The maximum length of a string that can be stored in
53
 
i_s_trx_row_t::trx_foreign_key_error */
54
 
#define TRX_I_S_TRX_FK_ERROR_MAX_LEN    256
55
 
 
56
 
/** The maximum length of a string that can be stored in
57
 
i_s_trx_row_t::trx_isolation_level */
58
 
#define TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN     16
59
 
 
60
 
/** Safely copy strings in to the INNODB_TRX table's
61
 
string based columns */
62
 
#define TRX_I_S_STRING_COPY(data, field, constraint, tcache)    \
63
 
do {                                                            \
64
 
        if (strlen(data) > constraint) {                        \
65
 
                char    buff[constraint + 1];                   \
66
 
                strncpy(buff, data, constraint);                \
67
 
                buff[constraint] = '\0';                        \
68
 
                                                                \
69
 
                field = static_cast<const char *>(ha_storage_put_memlim(                        \
70
 
                        (tcache)->storage, buff, constraint + 1,\
71
 
                        MAX_ALLOWED_FOR_STORAGE(tcache)));      \
72
 
        } else {                                                \
73
 
                field = static_cast<const char *>(ha_storage_put_str_memlim(            \
74
 
                        (tcache)->storage, data,                \
75
 
                        MAX_ALLOWED_FOR_STORAGE(tcache)));      \
76
 
        }                                                       \
77
 
} while (0)
78
 
 
79
47
/** A row of INFORMATION_SCHEMA.innodb_locks */
80
48
typedef struct i_s_locks_row_struct     i_s_locks_row_t;
81
49
/** A row of INFORMATION_SCHEMA.innodb_trx */
96
64
 
97
65
/** This structure represents INFORMATION_SCHEMA.innodb_locks row */
98
66
struct i_s_locks_row_struct {
99
 
        trx_id_t        lock_trx_id;    /*!< transaction identifier */
 
67
        ullint          lock_trx_id;    /*!< transaction identifier */
100
68
        const char*     lock_mode;      /*!< lock mode from
101
69
                                        lock_get_mode_str() */
102
70
        const char*     lock_type;      /*!< lock type from
117
85
 
118
86
        /** The following are auxiliary and not included in the table */
119
87
        /* @{ */
120
 
        table_id_t      lock_table_id;
 
88
        ullint          lock_table_id;
121
89
                                        /*!< table identifier from
122
90
                                        lock_get_table_id */
123
91
        i_s_hash_chain_t hash_chain;    /*!< hash table chain node for
127
95
 
128
96
/** This structure represents INFORMATION_SCHEMA.innodb_trx row */
129
97
struct i_s_trx_row_struct {
130
 
        trx_id_t                trx_id;         /*!< transaction identifier */
 
98
        ullint                  trx_id;         /*!< transaction identifier */
131
99
        const char*             trx_state;      /*!< transaction state from
132
100
                                                trx_get_que_state_str() */
133
101
        ib_time_t               trx_started;    /*!< trx_struct::start_time */
134
102
        const i_s_locks_row_t*  requested_lock_row;
135
 
                                        /*!< pointer to a row
136
 
                                        in innodb_locks if trx
137
 
                                        is waiting, or NULL */
138
 
        ib_time_t       trx_wait_started; /*!< trx_struct::wait_started */
139
 
        ullint          trx_weight;     /*!< TRX_WEIGHT() */
140
 
        ulint           trx_mysql_thread_id; /*!< thd_get_thread_id() */
141
 
        const char*     trx_query;      /*!< MySQL statement being
142
 
                                        executed in the transaction */
143
 
        const char*     trx_operation_state; /*!< trx_struct::op_info */
144
 
        ulint           trx_tables_in_use;/*!< n_mysql_tables_in_use in
145
 
                                         trx_struct */
146
 
        ulint           trx_tables_locked;
147
 
                                        /*!< mysql_n_tables_locked in
148
 
                                        trx_struct */
149
 
        ulint           trx_lock_structs;/*!< list len of trx_locks in
150
 
                                        trx_struct */
151
 
        ulint           trx_lock_memory_bytes;
152
 
                                        /*!< mem_heap_get_size(
153
 
                                        trx->lock_heap) */
154
 
        ulint           trx_rows_locked;/*!< lock_number_of_rows_locked() */
155
 
        ullint          trx_rows_modified;/*!< trx_struct::undo_no */
156
 
        ulint           trx_concurrency_tickets;
157
 
                                        /*!< n_tickets_to_enter_innodb in
158
 
                                        trx_struct */
159
 
        const char*     trx_isolation_level;
160
 
                                        /*!< isolation_level in trx_struct*/
161
 
        ibool           trx_unique_checks;
162
 
                                        /*!< check_unique_secondary in
163
 
                                        trx_struct*/
164
 
        ibool           trx_foreign_key_checks;
165
 
                                        /*!< check_foreigns in trx_struct */
166
 
        const char*     trx_foreign_key_error;
167
 
                                        /*!< detailed_error in trx_struct */
168
 
        ibool           trx_has_search_latch;
169
 
                                        /*!< has_search_latch in trx_struct */
170
 
        ulint           trx_search_latch_timeout;
171
 
                                        /*!< search_latch_timeout in
172
 
                                        trx_struct */
 
103
                                                /*!< pointer to a row
 
104
                                                in innodb_locks if trx
 
105
                                                is waiting, or NULL */
 
106
        ib_time_t               trx_wait_started;
 
107
                                                /*!< trx_struct::wait_started */
 
108
        ullint                  trx_weight;     /*!< TRX_WEIGHT() */
 
109
        ulint                   trx_mysql_thread_id;
 
110
                                                /*!< thd_get_thread_id() */
 
111
        const char*             trx_query;      /*!< MySQL statement being
 
112
                                                executed in the transaction */
173
113
};
174
114
 
175
115
/** This structure represents INFORMATION_SCHEMA.innodb_lock_waits row */