MySQL 8.4.2
Source Code Documentation
rem0types.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1994, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/rem0types.h
29 Record manager global types
30
31 Created 5/30/1994 Heikki Tuuri
32 *************************************************************************/
33
34#ifndef rem0types_h
35#define rem0types_h
36
37#include "data0type.h"
38#include "univ.i"
39
40/* We define the physical record simply as an array of bytes */
41typedef byte rec_t;
42
43/* Maximum values for various fields (for non-blob tuples) */
44constexpr uint32_t REC_MAX_N_FIELDS = 1024 - 1;
45constexpr uint32_t REC_MAX_HEAP_NO = 2 * 8192 - 1;
46constexpr uint32_t REC_MAX_N_OWNED = 16 - 1;
47
48/* Maximum number of user defined fields/columns. The reserved columns
49are the ones InnoDB adds internally: DB_ROW_ID, DB_TRX_ID, DB_ROLL_PTR.
50We need "* 2" because mlog_parse_index() creates a dummy table object
51possibly, with some of the system columns in it, and then adds the 3
52system columns (again) using dict_table_add_system_columns(). The problem
53is that mlog_parse_index() cannot recognize the system columns by
54just having n_fields, n_uniq and the lengths of the columns. */
55constexpr uint32_t REC_MAX_N_USER_FIELDS =
57
58/* REC_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and is the maximum
59indexed field length (or indexed prefix length) for indexes on tables of
60ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT format.
61Before we support UTF-8 encodings with mbmaxlen = 4, a UTF-8 character
62may take at most 3 bytes. So the limit was set to 3*256, so that one
63can create a column prefix index on 256 characters of a TEXT or VARCHAR
64column also in the UTF-8 charset.
65This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data
66files would be at risk! */
67constexpr uint32_t REC_ANTELOPE_MAX_INDEX_COL_LEN = 768;
68
69/** Maximum indexed field length for tables that have atomic BLOBs.
70This (3072) is the maximum index row length allowed, so we cannot create index
71prefix column longer than that. */
72constexpr uint32_t REC_VERSION_56_MAX_INDEX_COL_LEN = 3072;
73
74/** Innodb row types are a subset of the MySQL global enum row_type.
75They are made into their own enum so that switch statements can account
76for each of them. */
78 REC_FORMAT_REDUNDANT = 0, /*!< REDUNDANT row format */
79 REC_FORMAT_COMPACT = 1, /*!< COMPACT row format */
80 REC_FORMAT_COMPRESSED = 2, /*!< COMPRESSED row format */
81 REC_FORMAT_DYNAMIC = 3 /*!< DYNAMIC row format */
82};
84
85#endif
Data types.
constexpr uint32_t DATA_N_SYS_COLS
number of system columns defined above
Definition: data0type.h:194
rec_format_enum
Innodb row types are a subset of the MySQL global enum row_type.
Definition: rem0types.h:77
@ REC_FORMAT_REDUNDANT
REDUNDANT row format.
Definition: rem0types.h:78
@ REC_FORMAT_COMPRESSED
COMPRESSED row format.
Definition: rem0types.h:80
@ REC_FORMAT_COMPACT
COMPACT row format.
Definition: rem0types.h:79
@ REC_FORMAT_DYNAMIC
DYNAMIC row format.
Definition: rem0types.h:81
constexpr uint32_t REC_ANTELOPE_MAX_INDEX_COL_LEN
Definition: rem0types.h:67
constexpr uint32_t REC_VERSION_56_MAX_INDEX_COL_LEN
Maximum indexed field length for tables that have atomic BLOBs.
Definition: rem0types.h:72
byte rec_t
Definition: rem0types.h:41
enum rec_format_enum rec_format_t
Definition: rem0types.h:83
constexpr uint32_t REC_MAX_N_USER_FIELDS
Definition: rem0types.h:55
constexpr uint32_t REC_MAX_N_FIELDS
Definition: rem0types.h:44
constexpr uint32_t REC_MAX_N_OWNED
Definition: rem0types.h:46
constexpr uint32_t REC_MAX_HEAP_NO
Definition: rem0types.h:45
Version control for database, common definitions, and include files.