MySQL 5.6.14 Source Code Document
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
innodb_api.h
Go to the documentation of this file.
1
/***********************************************************************
2
3
Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it
6
under the terms of the GNU General Public License as published by the
7
Free Software Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but
10
WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
12
Public License for more details.
13
14
You should have received a copy of the GNU General Public License along
15
with this program; if not, write to the Free Software Foundation, Inc.,
16
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
18
***********************************************************************/
19
/**************************************************/
25
#ifndef innodb_api_h
26
#define innodb_api_h
27
28
#include "
api0api.h
"
29
#include "
innodb_engine.h
"
30
#include "assert.h"
31
#include "
handler_api.h
"
32
34
#define LOCK_CONN_IF_NOT_LOCKED(has_lock, engine) \
35
if (!(has_lock)) { \
36
pthread_mutex_lock(&(engine)->conn_mutex); \
37
}
38
39
#define UNLOCK_CONN_IF_NOT_LOCKED(has_lock, engine) \
40
if (!(has_lock)) { \
41
pthread_mutex_unlock(&(engine)->conn_mutex); \
42
}
43
46
#define LOCK_CURRENT_CONN_IF_NOT_LOCKED(has_lock, conn) \
47
if (!(has_lock)) { \
48
pthread_mutex_lock(&(conn)->curr_conn_mutex); \
49
}
50
51
#define UNLOCK_CURRENT_CONN_IF_NOT_LOCKED(has_lock, conn) \
52
if (!(has_lock)) { \
53
pthread_mutex_unlock(&(conn)->curr_conn_mutex); \
54
}
55
58
#define MCI_COL_TO_GET 5
59
60
typedef
enum
mci_col
{
61
MCI_COL_KEY
,
62
MCI_COL_VALUE
,
63
MCI_COL_FLAG
,
64
MCI_COL_CAS
,
65
MCI_COL_EXP
66
} mci_col_t;
67
72
typedef
struct
mci_column
{
73
char
*
value_str
;
74
int
value_len
;
75
uint64_t
value_int
;
76
bool
is_str
;
77
bool
is_valid
;
79
bool
is_null
;
80
bool
allocated
;
82
}
mci_column_t
;
83
93
typedef
struct
mci_item
{
94
mci_column_t
col_value
[
MCI_COL_TO_GET
];
95
mci_column_t
*
extra_col_value
;
98
int
n_extra_col
;
100
}
mci_item_t
;
101
102
103
/*************************************************************/
105
void
106
register_innodb_cb
(
107
/*===============*/
108
void
* p);
110
/*********************************************************************
111
Open a table and return a cursor for the table. */
112
ib_err_t
113
innodb_api_begin
(
114
/*=============*/
115
innodb_engine_t
*
116
engine,
117
const
char
* dbname,
118
const
char
*
name
,
119
innodb_conn_data_t
* conn_data,
121
ib_trx_t
ib_trx,
122
ib_crsr_t
* crsr,
123
ib_crsr_t
* idx_crsr,
124
ib_lck_mode_t
lock_mode);
126
/*************************************************************/
129
ib_err_t
130
innodb_api_search
(
131
/*==============*/
132
innodb_conn_data_t
* cursor_data,
133
ib_crsr_t
* crsr,
134
const
char
* key,
135
int
len,
136
mci_item_t
* item,
137
ib_tpl_t
* r_tpl,
138
bool
sel_only);
140
/*************************************************************/
143
ib_err_t
144
innodb_api_insert
(
145
/*==============*/
146
innodb_engine_t
* engine,
147
innodb_conn_data_t
* cursor_data,
148
const
char
* key,
149
int
len,
150
uint32_t val_len,
151
uint64_t exp,
152
uint64_t* cas,
153
uint64_t
flags
);
155
/*************************************************************/
158
ENGINE_ERROR_CODE
159
innodb_api_delete
(
160
/*==============*/
161
innodb_engine_t
* engine,
162
innodb_conn_data_t
* cursor_data,
163
const
char
* key,
164
int
len);
166
/*************************************************************/
169
ENGINE_ERROR_CODE
170
innodb_api_arithmetic
(
171
/*==================*/
172
innodb_engine_t
* engine,
173
innodb_conn_data_t
* cursor_data,
174
const
char
* key,
175
int
len,
176
int
delta,
177
bool
increment,
178
uint64_t* cas,
179
rel_time_t exp_time,
180
bool
create,
182
uint64_t initial,
183
uint64_t* result);
185
/*************************************************************/
194
ENGINE_ERROR_CODE
195
innodb_api_store
(
196
/*=============*/
197
innodb_engine_t
* engine,
198
innodb_conn_data_t
* cursor_data,
199
const
char
* key,
200
int
len,
201
uint32_t val_len,
202
uint64_t exp,
203
uint64_t* cas,
204
uint64_t input_cas,
205
uint64_t
flags
,
206
ENGINE_STORE_OPERATION op);
208
/*********************************************************************
209
Implement the "flush_all" command, map to InnoDB's trunk table operation
210
return ENGINE_SUCCESS is all successful */
211
ENGINE_ERROR_CODE
212
innodb_api_flush
(
213
/*=============*/
214
innodb_engine_t
* engine,
215
innodb_conn_data_t
* conn_data,
217
const
char
* dbname,
218
const
char
*
name
);
220
/*************************************************************/
222
uint64_t
223
mci_get_time
(
void
);
224
/*==============*/
225
227
typedef
enum
conn_op_type
{
228
CONN_OP_READ
,
229
CONN_OP_WRITE
,
230
CONN_OP_DELETE
,
231
CONN_OP_FLUSH
232
}
conn_op_type_t
;
233
234
/*************************************************************/
237
void
238
innodb_api_cursor_reset
(
239
/*====================*/
240
innodb_engine_t
* engine,
242
innodb_conn_data_t
* conn_data,
244
conn_op_type_t
op_type,
246
bool
commit);
248
/*************************************************************/
251
bool
252
innodb_reset_conn
(
253
/*==============*/
254
innodb_conn_data_t
* conn_data,
256
bool
has_lock,
258
bool
commit,
259
bool
has_binlog);
261
/**********************************************************************/
265
ib_err_t
266
innodb_verify_low
(
267
/*==============*/
268
meta_cfg_info_t
* info,
270
ib_crsr_t
crsr,
271
bool
runtime);
274
/*************************************************************/
278
ib_err_t
279
innodb_cb_cursor_close
(
280
/*===================*/
281
ib_crsr_t
ib_crsr);
283
/*************************************************************/
286
ib_trx_t
287
innodb_cb_trx_begin
(
288
/*================*/
289
ib_trx_level_t
ib_trx_level);
291
/*************************************************************/
294
ib_err_t
295
innodb_cb_trx_commit
(
296
/*=================*/
297
ib_trx_t
ib_trx);
299
/*************************************************************/
302
ib_err_t
303
innodb_cb_close_thd
(
304
/*=================*/
305
void
* thd);
307
/*****************************************************************/
310
ib_err_t
311
innodb_cb_cursor_new_trx
(
312
/*=====================*/
313
ib_crsr_t
ib_crsr,
314
ib_trx_t
ib_trx);
316
/*****************************************************************/
319
ib_err_t
320
innodb_cb_cursor_lock
(
321
/*==================*/
322
innodb_engine_t
* eng,
323
ib_crsr_t
ib_crsr,
324
ib_lck_mode_t
ib_lck_mode);
326
/*****************************************************************/
329
ib_tpl_t
330
innodb_cb_read_tuple_create
(
331
/*========================*/
332
ib_crsr_t
ib_crsr);
334
/*****************************************************************/
337
ib_err_t
338
innodb_cb_cursor_first
(
339
/*===================*/
340
ib_crsr_t
ib_crsr);
342
/*****************************************************************/
345
ib_err_t
346
innodb_cb_read_row
(
347
/*===============*/
348
ib_crsr_t
ib_crsr,
349
ib_tpl_t
ib_tpl);
351
/*****************************************************************/
354
ib_ulint_t
355
innodb_cb_col_get_meta
(
356
/*===================*/
357
ib_tpl_t
ib_tpl,
358
ib_ulint_t
i
,
359
ib_col_meta_t
* ib_col_meta);
361
/*****************************************************************/
363
void
364
innodb_cb_tuple_delete
(
365
/*===================*/
366
ib_tpl_t
ib_tpl);
368
/*****************************************************************/
371
ib_ulint_t
372
innodb_cb_tuple_get_n_cols
(
373
/*=======================*/
374
const
ib_tpl_t
ib_tpl);
376
/*****************************************************************/
379
const
void
*
380
innodb_cb_col_get_value
(
381
/*====================*/
382
ib_tpl_t
ib_tpl,
383
ib_ulint_t
i
);
385
/********************************************************************/
388
ib_err_t
389
innodb_cb_open_table
(
390
/*=================*/
391
const
char
*
name
,
392
ib_trx_t
ib_trx,
393
ib_crsr_t
* ib_crsr);
395
/*****************************************************************/
398
char
*
399
innodb_cb_col_get_name
(
400
/*===================*/
401
ib_crsr_t
ib_crsr,
402
ib_ulint_t
i
);
404
/*****************************************************************/
407
ib_err_t
408
innodb_cb_cursor_open_index_using_name
(
409
/*===================================*/
410
ib_crsr_t
ib_open_crsr,
411
const
char
* index_name,
412
ib_crsr_t
* ib_crsr,
413
int
* idx_type,
414
ib_id_u64_t* idx_id);
416
/*****************************************************************/
419
int
420
innodb_cb_get_cfg
();
421
/*===============*/
422
#endif
plugin
innodb_memcached
innodb_memcache
include
innodb_api.h
Generated on Sat Nov 9 2013 01:25:13 for MySQL 5.6.14 Source Code Document by
1.8.1.2