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