~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2010-11-03 03:28:23 UTC
  • mto: (1902.1.1 build) (1910.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: stewart@flamingspork.com-20101103032823-44k21f0njmk97omr
fix docs warning: Title underline (and overline) is too short in brief_history_of_drizzle.rst

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1997, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1997, 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
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
 
 
49
38
/** Combinations of operations that can be buffered.  Because the enum
50
39
values are used for indexing innobase_change_buffering_values[], they
51
40
should start at 0 and there should not be any gaps. */
52
41
typedef enum {
53
42
        IBUF_USE_NONE = 0,
54
43
        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 */
59
44
 
60
45
        IBUF_USE_COUNT          /* number of entries in ibuf_use_t */
61
46
} ibuf_use_t;
63
48
/** Operations that can currently be buffered. */
64
49
extern ibuf_use_t       ibuf_use;
65
50
 
66
 
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
67
 
/** Flag to control insert buffer debugging. */
68
 
extern uint             ibuf_debug;
69
 
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
70
 
 
71
51
/** The insert buffer control structure */
72
52
extern ibuf_t*          ibuf;
73
53
 
92
72
free bits could momentarily be set too high. */
93
73
 
94
74
/******************************************************************//**
95
 
Creates the insert buffer data structure at a database startup. */
 
75
Creates the insert buffer data structure at a database startup and
 
76
initializes the data structures for the insert buffer of each tablespace. */
96
77
UNIV_INTERN
97
78
void
98
79
ibuf_init_at_db_start(void);
262
243
ibuf_free_excess_pages(void);
263
244
/*========================*/
264
245
/*********************************************************************//**
265
 
Buffer an operation in the insert/delete buffer, instead of doing it
266
 
directly to the disk page, if this is possible. Does not do it if the index
267
 
is clustered or unique.
 
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.
268
249
@return TRUE if success */
269
250
UNIV_INTERN
270
251
ibool
271
252
ibuf_insert(
272
253
/*========*/
273
 
        ibuf_op_t       op,     /*!< in: operation type */
274
254
        const dtuple_t* entry,  /*!< in: index entry to insert */
275
255
        dict_index_t*   index,  /*!< in: index where to insert */
276
256
        ulint           space,  /*!< in: space id where to insert */
279
259
        que_thr_t*      thr);   /*!< in: query thread */
280
260
/*********************************************************************//**
281
261
When an index page is read from a disk to the buffer pool, this function
282
 
applies any buffered operations to the page and deletes the entries from the
283
 
insert buffer. If the page is not read, but created in the buffer pool, this
284
 
function deletes its buffered entries from the insert buffer; there can
285
 
exist entries for such a page if the page belonged to an index which
286
 
subsequently was dropped. */
 
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. */
287
267
UNIV_INTERN
288
268
void
289
269
ibuf_merge_or_delete_for_page(
376
356
ibuf_print(
377
357
/*=======*/
378
358
        FILE*   file);  /*!< in: file where to print */
379
 
/********************************************************************
380
 
Read the first two bytes from a record's fourth field (counter field in new
381
 
records; something else in older records).
382
 
@return "counter" field, or ULINT_UNDEFINED if for some reason it can't be read */
383
 
UNIV_INTERN
384
 
ulint
385
 
ibuf_rec_get_counter(
386
 
/*=================*/
387
 
        const rec_t*    rec);   /*!< in: ibuf record */
388
359
/******************************************************************//**
389
360
Closes insert buffer and frees the data structures. */
390
361
UNIV_INTERN