~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#ifndef UNIV_HOTBACKUP
36
36
# include "ibuf0types.h"
37
37
 
 
38
/* Possible operations buffered in the insert/whatever buffer. See
 
39
ibuf_insert(). DO NOT CHANGE THE VALUES OF THESE, THEY ARE STORED ON DISK. */
 
40
typedef enum {
 
41
        IBUF_OP_INSERT = 0,
 
42
        IBUF_OP_DELETE_MARK = 1,
 
43
        IBUF_OP_DELETE = 2,
 
44
 
 
45
        /* Number of different operation types. */
 
46
        IBUF_OP_COUNT = 3
 
47
} ibuf_op_t;
 
48
 
38
49
/** Combinations of operations that can be buffered.  Because the enum
39
50
values are used for indexing innobase_change_buffering_values[], they
40
51
should start at 0 and there should not be any gaps. */
41
52
typedef enum {
42
53
        IBUF_USE_NONE = 0,
43
54
        IBUF_USE_INSERT,        /* insert */
 
55
        IBUF_USE_DELETE_MARK,   /* delete */
 
56
        IBUF_USE_INSERT_DELETE_MARK,    /* insert+delete */
 
57
        IBUF_USE_DELETE,        /* delete+purge */
 
58
        IBUF_USE_ALL,           /* insert+delete+purge */
44
59
 
45
60
        IBUF_USE_COUNT          /* number of entries in ibuf_use_t */
46
61
} ibuf_use_t;
72
87
free bits could momentarily be set too high. */
73
88
 
74
89
/******************************************************************//**
75
 
Creates the insert buffer data structure at a database startup and
76
 
initializes the data structures for the insert buffer of each tablespace. */
 
90
Creates the insert buffer data structure at a database startup. */
77
91
UNIV_INTERN
78
92
void
79
93
ibuf_init_at_db_start(void);
243
257
ibuf_free_excess_pages(void);
244
258
/*========================*/
245
259
/*********************************************************************//**
246
 
Makes an index insert to the insert buffer, instead of directly to the disk
247
 
page, if this is possible. Does not do insert if the index is clustered
248
 
or unique.
 
260
Buffer an operation in the insert/delete buffer, instead of doing it
 
261
directly to the disk page, if this is possible. Does not do it if the index
 
262
is clustered or unique.
249
263
@return TRUE if success */
250
264
UNIV_INTERN
251
265
ibool
252
266
ibuf_insert(
253
267
/*========*/
 
268
        ibuf_op_t       op,     /*!< in: operation type */
254
269
        const dtuple_t* entry,  /*!< in: index entry to insert */
255
270
        dict_index_t*   index,  /*!< in: index where to insert */
256
271
        ulint           space,  /*!< in: space id where to insert */
259
274
        que_thr_t*      thr);   /*!< in: query thread */
260
275
/*********************************************************************//**
261
276
When an index page is read from a disk to the buffer pool, this function
262
 
inserts to the page the possible index entries buffered in the insert buffer.
263
 
The entries are deleted from the insert buffer. If the page is not read, but
264
 
created in the buffer pool, this function deletes its buffered entries from
265
 
the insert buffer; there can exist entries for such a page if the page
266
 
belonged to an index which subsequently was dropped. */
 
277
applies any buffered operations to the page and deletes the entries from the
 
278
insert buffer. If the page is not read, but created in the buffer pool, this
 
279
function deletes its buffered entries from the insert buffer; there can
 
280
exist entries for such a page if the page belonged to an index which
 
281
subsequently was dropped. */
267
282
UNIV_INTERN
268
283
void
269
284
ibuf_merge_or_delete_for_page(
356
371
ibuf_print(
357
372
/*=======*/
358
373
        FILE*   file);  /*!< in: file where to print */
 
374
/********************************************************************
 
375
Read the first two bytes from a record's fourth field (counter field in new
 
376
records; something else in older records).
 
377
@return "counter" field, or ULINT_UNDEFINED if for some reason it can't be read */
 
378
UNIV_INTERN
 
379
ulint
 
380
ibuf_rec_get_counter(
 
381
/*=================*/
 
382
        const rec_t*    rec);   /*!< in: ibuf record */
359
383
/******************************************************************//**
360
384
Closes insert buffer and frees the data structures. */
361
385
UNIV_INTERN