1 /*****************************************************************************
3 Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
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.
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.
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.,
15 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *****************************************************************************/
19 /**************************************************//**
20 @file include/dict0boot.ic
21 Data dictionary creation and booting
23 Created 4/18/1996 Heikki Tuuri
24 *******************************************************/
26 /**********************************************************************//**
27 Writes the current value of the row id counter to the dictionary header file
31 dict_hdr_flush_row_id(void);
32 /*=======================*/
35 /**********************************************************************//**
40 dict_sys_get_new_row_id(void)
41 /*=========================*/
45 mutex_enter(&(dict_sys->mutex));
47 id = dict_sys->row_id;
49 if (0 == (ut_dulint_get_low(id) % DICT_HDR_ROW_ID_WRITE_MARGIN)) {
51 dict_hdr_flush_row_id();
54 UT_DULINT_INC(dict_sys->row_id);
56 mutex_exit(&(dict_sys->mutex));
61 /**********************************************************************//**
62 Reads a row id from a record or other 6-byte stored form.
68 byte* field) /*!< in: record field */
70 #if DATA_ROW_ID_LEN != 6
71 # error "DATA_ROW_ID_LEN != 6"
74 return(mach_read_from_6(field));
77 /**********************************************************************//**
78 Writes a row id to a record or other 6-byte stored form. */
81 dict_sys_write_row_id(
82 /*==================*/
83 byte* field, /*!< in: record field */
84 dulint row_id) /*!< in: row id */
86 #if DATA_ROW_ID_LEN != 6
87 # error "DATA_ROW_ID_LEN != 6"
90 mach_write_to_6(field, row_id);