~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/dict0boot.ic

  • Committer: Monty Taylor
  • Date: 2010-04-22 02:46:23 UTC
  • mto: (1497.3.4 enable-dtrace)
  • mto: This revision was merged to the branch mainline in revision 1527.
  • Revision ID: mordred@inaugust.com-20100422024623-4urw8fi8eraci08p
Don't overwrite the pandora_vc_revinfo file if we don't have new
authoratative information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/**************************************************//**
20
 
@file include/dict0boot.ic
21
 
Data dictionary creation and booting
22
 
 
23
 
Created 4/18/1996 Heikki Tuuri
24
 
*******************************************************/
25
 
 
26
 
/**********************************************************************//**
27
 
Writes the current value of the row id counter to the dictionary header file
28
 
page. */
29
 
UNIV_INTERN
30
 
void
31
 
dict_hdr_flush_row_id(void);
32
 
/*=======================*/
33
 
 
34
 
 
35
 
/**********************************************************************//**
36
 
Returns a new row id.
37
 
@return the new id */
38
 
UNIV_INLINE
39
 
row_id_t
40
 
dict_sys_get_new_row_id(void)
41
 
/*=========================*/
42
 
{
43
 
        row_id_t        id;
44
 
 
45
 
        mutex_enter(&(dict_sys->mutex));
46
 
 
47
 
        id = dict_sys->row_id;
48
 
 
49
 
        if (0 == (id % DICT_HDR_ROW_ID_WRITE_MARGIN)) {
50
 
 
51
 
                dict_hdr_flush_row_id();
52
 
        }
53
 
 
54
 
        dict_sys->row_id++;
55
 
 
56
 
        mutex_exit(&(dict_sys->mutex));
57
 
 
58
 
        return(id);
59
 
}
60
 
 
61
 
/**********************************************************************//**
62
 
Reads a row id from a record or other 6-byte stored form.
63
 
@return row id */
64
 
UNIV_INLINE
65
 
row_id_t
66
 
dict_sys_read_row_id(
67
 
/*=================*/
68
 
        const byte*     field)  /*!< in: record field */
69
 
{
70
 
#if DATA_ROW_ID_LEN != 6
71
 
# error "DATA_ROW_ID_LEN != 6"
72
 
#endif
73
 
 
74
 
        return(mach_read_from_6(field));
75
 
}
76
 
 
77
 
/**********************************************************************//**
78
 
Writes a row id to a record or other 6-byte stored form. */
79
 
UNIV_INLINE
80
 
void
81
 
dict_sys_write_row_id(
82
 
/*==================*/
83
 
        byte*           field,  /*!< in: record field */
84
 
        row_id_t        row_id) /*!< in: row id */
85
 
{
86
 
#if DATA_ROW_ID_LEN != 6
87
 
# error "DATA_ROW_ID_LEN != 6"
88
 
#endif
89
 
 
90
 
        mach_write_to_6(field, row_id);
91
 
}
92
 
 
93