~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.h

  • Committer: Monty Taylor
  • Date: 2010-06-18 00:34:51 UTC
  • mto: (1627.2.5 build)
  • mto: This revision was merged to the branch mainline in revision 1628.
  • Revision ID: mordred@inaugust.com-20100618003451-2b3fs2m2hvpch91r
Add function pointer hook for plugins to register program_options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 2000, 2009, MySQL AB & 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
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
31
31
#include <drizzled/plugin/transactional_storage_engine.h>
32
32
 
33
33
using namespace drizzled;
34
 
 
35
 
/* Structure defines translation table between mysql index and innodb
36
 
index structures */
37
 
typedef struct innodb_idx_translate_struct {
38
 
        ulint           index_count;    /*!< number of valid index entries
39
 
                                        in the index_mapping array */
40
 
        ulint           array_size;     /*!< array size of index_mapping */
41
 
        dict_index_t**  index_mapping;  /*!< index pointer array directly
42
 
                                        maps to index in Innodb from MySQL
43
 
                                        array index */
44
 
} innodb_idx_translate_t;
45
 
 
46
34
/** InnoDB table share */
47
35
typedef struct st_innobase_share {
48
36
        THR_LOCK        lock;           /*!< MySQL lock protecting
49
37
                                        this structure */
50
 
        char    table_name[FN_REFLEN];  /*!< InnoDB table name */
 
38
        const char*     table_name;     /*!< InnoDB table name */
51
39
        uint            use_count;      /*!< reference count,
52
40
                                        incremented in get_share()
53
41
                                        and decremented in free_share() */
54
42
        void*           table_name_hash;/*!< hash table chain node */
55
 
        innodb_idx_translate_t  idx_trans_tbl;  /*!< index translation
56
 
                                                table between MySQL and
57
 
                                                Innodb */
58
 
 
59
 
        st_innobase_share(const char *arg) :
60
 
          use_count(0)
61
 
        {
62
 
          strncpy(table_name, arg, FN_REFLEN);
63
 
        }
64
 
 
65
43
} INNOBASE_SHARE;
66
44
 
67
45
 
115
93
        UNIV_INTERN ulint innobase_reset_autoinc(uint64_t auto_inc);
116
94
        UNIV_INTERN ulint innobase_get_autoinc(uint64_t* value);
117
95
        ulint innobase_update_autoinc(uint64_t  auto_inc);
118
 
        UNIV_INTERN void innobase_initialize_autoinc();
 
96
        UNIV_INTERN ulint innobase_initialize_autoinc();
119
97
        UNIV_INTERN dict_index_t* innobase_get_index(uint keynr);
 
98
        UNIV_INTERN uint64_t innobase_get_int_col_max_value(const Field* field);
120
99
 
121
100
        /* Init values for the class: */
122
101
 public:
123
102
        UNIV_INTERN ha_innobase(plugin::StorageEngine &engine,
124
 
                                Table &table_arg);
 
103
                                TableShare &table_arg);
125
104
        UNIV_INTERN ~ha_innobase();
126
105
  /**
127
106
   * Returns the plugin::TransactionStorageEngine pointer
133
112
   */
134
113
  UNIV_INTERN plugin::TransactionalStorageEngine *getTransactionalEngine()
135
114
  {
136
 
    return static_cast<plugin::TransactionalStorageEngine *>(getEngine());
 
115
    return static_cast<plugin::TransactionalStorageEngine *>(engine);
137
116
  }
138
117
 
 
118
        /*
 
119
          Get the row type from the storage engine.  If this method returns
 
120
          ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
 
121
        */
 
122
        UNIV_INTERN enum row_type get_row_type() const;
 
123
 
139
124
        UNIV_INTERN const char* index_type(uint key_number);
140
125
        UNIV_INTERN const key_map* keys_to_use_for_scanning();
141
126
 
142
 
        UNIV_INTERN int doOpen(const drizzled::identifier::Table &identifier, int mode, uint test_if_locked);
 
127
        UNIV_INTERN int open(const char *name, int mode, uint test_if_locked);
143
128
        UNIV_INTERN int close(void);
144
129
        UNIV_INTERN double scan_time();
145
130
        UNIV_INTERN double read_time(uint index, uint ranges, ha_rows rows);
219
204
};
220
205
 
221
206
 
 
207
extern "C" {
 
208
 
222
209
/** Get the file name of the MySQL binlog.
223
210
 * @return the name of the binlog file
224
211
 */
237
224
*/
238
225
int session_slave_thread(const Session *session);
239
226
 
 
227
}
 
228
 
240
229
typedef struct trx_struct trx_t;
241
230
/********************************************************************//**
242
231
@file Cursor/ha_innodb.h
244
233
about a possible transaction rollback inside InnoDB caused by a lock wait
245
234
timeout or a deadlock.
246
235
@return MySQL error code */
247
 
UNIV_INTERN
 
236
extern "C" UNIV_INTERN
248
237
int
249
238
convert_error_code_to_mysql(
250
239
/*========================*/
255
244
/*********************************************************************//**
256
245
Allocates an InnoDB transaction for a MySQL Cursor object.
257
246
@return InnoDB transaction handle */
258
 
UNIV_INTERN
 
247
extern "C" UNIV_INTERN
259
248
trx_t*
260
249
innobase_trx_allocate(
261
250
/*==================*/
262
251
        Session         *session);      /*!< in: user thread handle */
263
 
 
264
 
/***********************************************************************
265
 
This function checks each index name for a table against reserved
266
 
system default primary index name 'GEN_CLUST_INDEX'. If a name matches,
267
 
this function pushes an error message to the client, and returns true. */
268
 
bool
269
 
innobase_index_name_is_reserved(
270
 
/*============================*/
271
 
                                        /* out: true if index name matches a
272
 
                                        reserved name */
273
 
        const trx_t*    trx,            /* in: InnoDB transaction handle */
274
 
        const drizzled::KeyInfo*        key_info,/* in: Indexes to be created */
275
 
        ulint           num_of_keys);   /* in: Number of indexes to
276
 
                                        be created. */
277
 
 
278
252
#endif /* INNODB_HANDLER_HA_INNODB_H */