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