MySQL 8.4.2
Source Code Documentation
univ.i File Reference

Version control for database, common definitions, and include files. More...

#include "m_string.h"
#include "my_thread.h"
#include <limits>
#include <sys/stat.h>
#include "my_psi_config.h"
#include <sched.h>
#include <sys/mman.h>
#include "my_config.h"
#include <inttypes.h>
#include <stdint.h>
#include <unistd.h>
#include "mysql/psi/mysql_file.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysql/psi/mysql_rwlock.h"
#include "mysql/psi/mysql_thread.h"
#include "pfs_file_provider.h"
#include "pfs_mutex_provider.h"
#include "pfs_rwlock_provider.h"
#include "pfs_thread_provider.h"
#include <stdio.h>
#include "db0err.h"
#include "sync0types.h"
#include "ut0dbg.h"
#include "ut0lst.h"
#include "ut0ut.h"

Macros

#define univ_i
 
#define _IB_TO_STR(s)   #s
 
#define IB_TO_STR(s)   _IB_TO_STR(s)
 
#define INNODB_VERSION_MAJOR   MYSQL_VERSION_MAJOR
 
#define INNODB_VERSION_MINOR   MYSQL_VERSION_MINOR
 
#define INNODB_VERSION_BUGFIX   MYSQL_VERSION_PATCH
 
#define INNODB_VERSION_SHORT   (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
 
#define INNODB_VERSION_STR
 
#define REFMAN
 
#define UNIV_PFS_MUTEX
 
#define UNIV_PFS_RWLOCK
 
#define UNIV_PFS_IO
 
#define UNIV_PFS_THREAD
 
#define UNIV_PFS_MEMORY
 
#define UNIV_BTR_DEBUG   /* check B-tree links */
 
#define UNIV_LIGHT_MEM_DEBUG   /* light memory debugging */
 
#define UNIV_COLD   /* empty */
 
#define UNIV_PAGE_SIZE_SHIFT   srv_page_size_shift
 The 2-logarithm of UNIV_PAGE_SIZE: More...
 
#define UNIV_PAGE_SIZE   ((ulint)srv_page_size)
 The universal page size of the database. More...
 
#define UNIV_PAGE_SSIZE_MAX    static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
 Largest possible ssize for an uncompressed page. More...
 
#define UNIV_PAGE_SSIZE_MIN    static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT_MIN - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
 Smallest possible ssize for an uncompressed page. More...
 
#define UINT16PF   "%" PRIu16
 
#define UINT32PF   "%" PRIu32
 
#define UINT32PFS   PRIu32
 
#define UINT64PF   "%" PRIu64
 
#define UINT64PFx   "%016" PRIx64
 
#define IB_ID_FMT   UINT64PF
 
#define ULINTPFS   "lu"
 
#define ULINTPF   "%" ULINTPFS
 
#define SPACE_ID_PF   UINT32PF
 
#define SPACE_ID_PFS   UINT32PFS
 
#define PAGE_NO_PF   UINT32PF
 
#define PAGE_ID_PF   "page " SPACE_ID_PF ":" PAGE_NO_PF
 
#define UNIV_NOTHROW
 
#define UNIV_EXPECT(expr, value)   expr
 
#define UNIV_LIKELY_NULL(expr)   expr
 
#define UNIV_PREFETCH_R(addr)   ((void)0)
 
#define UNIV_PREFETCH_RW(addr)   ((void)0)
 
#define UNIV_LIKELY(cond)   UNIV_EXPECT(cond, true)
 
#define UNIV_UNLIKELY(cond)   UNIV_EXPECT(cond, false)
 
#define UT_ARR_SIZE(a)   (sizeof(a) / sizeof((a)[0]))
 
#define OS_PATH_SEPARATOR_STR   "/"
 
#define OS_PATH_SEPARATOR   '/'
 
#define OS_PATH_SEPARATOR_ALT   '\\'
 
#define UNIV_MEM_VALID(addr, size)
 
#define UNIV_MEM_INVALID(addr, size)
 
#define UNIV_MEM_FREE(addr, size)
 
#define UNIV_MEM_ALLOC(addr, size)
 
#define UNIV_MEM_DESC(addr, size)
 
#define UNIV_MEM_UNDESC(b)
 
#define UNIV_MEM_ASSERT_RW_LOW(addr, size, should_abort)
 
#define UNIV_MEM_ASSERT_RW(addr, size)
 
#define UNIV_MEM_ASSERT_RW_ABORT(addr, size)
 
#define UNIV_MEM_ASSERT_W(addr, size)
 
#define UNIV_MEM_TRASH(addr, c, size)
 
#define UNIV_MEM_ASSERT_AND_FREE(addr, size)
 
#define UNIV_MEM_ASSERT_AND_ALLOC(addr, size)
 
#define INNODB_DD_TABLE(name, n_indexes)    { name, n_indexes }
 Hard-coded data dictionary entry. More...
 
#define IF_DEBUG(...)   __VA_ARGS__
 
#define IF_ENABLED(s, ...)
 
#define IF_AHI_DEBUG(...)   __VA_ARGS__
 

Typedefs

using byte = unsigned char
 
typedef unsigned long int ulint
 
typedef long int lint
 
typedef uint64_t ib_id_t
 The generic InnoDB system object identifier data type. More...
 
typedef uint32_t page_no_t
 Page number. More...
 
typedef uint32_t space_id_t
 Tablespace identifier. More...
 
typedef void * os_thread_ret_t
 
using Col_offsets_t = ulint
 

Functions

template<typename T >
void call_destructor (T *p)
 Explicitly call the destructor, this is to get around Clang bug#12350. More...
 
template<typename T >
constexpr auto to_int (T v) -> typename std::underlying_type< T >::type
 

Variables

constexpr size_t UNIV_WORD_SIZE = SIZEOF_LONG
 MySQL config.h generated by CMake will define SIZEOF_LONG in Posix. More...
 
constexpr uint32_t UNIV_MEM_ALIGNMENT = 8
 The following alignment is used in memory allocations in memory heap management to ensure correct alignment for doubles etc. More...
 
constexpr uint32_t UNIV_ZIP_SIZE_SHIFT_MIN = 10
 log2 of smallest compressed page size (1<<10 == 1024 bytes) Note: This must never change! More...
 
constexpr uint32_t UNIV_ZIP_SIZE_SHIFT_MAX = 14
 log2 of largest compressed page size (1<<14 == 16384 bytes). More...
 
constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_MIN = 12
 Minimum Page Size Shift (power of 2) More...
 
constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_MAX = 16
 Maximum Page Size Shift (power of 2) More...
 
constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_DEF = 14
 Default Page Size Shift (power of 2) More...
 
constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_ORIG = 14
 Original 16k InnoDB Page Size Shift, in case the default changes. More...
 
constexpr uint32_t UNIV_PAGE_SSIZE_ORIG = UNIV_PAGE_SIZE_SHIFT_ORIG - 9
 Original 16k InnoDB Page Size as an ssize (log2 - 9) More...
 
constexpr uint32_t UNIV_PAGE_SIZE_MIN = 1 << UNIV_PAGE_SIZE_SHIFT_MIN
 Minimum page size InnoDB currently supports. More...
 
constexpr size_t UNIV_PAGE_SIZE_MAX = 1 << UNIV_PAGE_SIZE_SHIFT_MAX
 Maximum page size InnoDB currently supports. More...
 
constexpr uint32_t UNIV_PAGE_SIZE_DEF = 1 << UNIV_PAGE_SIZE_SHIFT_DEF
 Default page size for InnoDB tablespaces. More...
 
constexpr uint32_t UNIV_PAGE_SIZE_ORIG = 1 << UNIV_PAGE_SIZE_SHIFT_ORIG
 Original 16k page size for InnoDB tablespaces. More...
 
constexpr uint32_t UNIV_ZIP_SIZE_MIN = 1 << UNIV_ZIP_SIZE_SHIFT_MIN
 Smallest compressed page size. More...
 
constexpr uint32_t UNIV_ZIP_SIZE_MAX = 1 << UNIV_ZIP_SIZE_SHIFT_MAX
 Largest compressed page size. More...
 
constexpr uint32_t UNIV_MAX_PARALLELISM = 32
 Maximum number of parallel threads in a parallelized operation. More...
 
constexpr uint32_t FILENAME_CHARSET_MAXNAMLEN = 5
 This is the "mbmaxlen" for my_charset_filename (defined in strings/ctype-utf8.c), which is used to encode File and Database names. More...
 
constexpr uint32_t MAX_TABLE_NAME_LEN = 320
 The maximum length of an encode table name in bytes. More...
 
constexpr uint32_t MAX_DATABASE_NAME_LEN = MAX_TABLE_NAME_LEN
 The maximum length of a database name. More...
 
constexpr uint32_t MAX_FULL_NAME_LEN
 MAX_FULL_NAME_LEN defines the full name path including the database name and table name. More...
 
constexpr uint32_t MAX_COMPRESSION_LEN = 4
 Maximum length of the compression algorithm string. More...
 
constexpr ulint ULINT_UNDEFINED = ~ulint{0U}
 The 'undefined' value for a ulint. More...
 
constexpr ulong ULONG_UNDEFINED = ~0UL
 
constexpr uint64_t UINT64_UNDEFINED = ~0ULL
 The 'undefined' value for a 64-bit unsigned integer. More...
 
constexpr uint32_t UINT32_UNDEFINED = ~0U
 The 'undefined' value for a 32-bit unsigned integer. More...
 
constexpr uint16_t UINT16_UNDEFINED = std::numeric_limits<uint16_t>::max()
 The 'undefined' value for a 16-bit unsigned integer. More...
 
constexpr uint8_t UINT8_UNDEFINED = std::numeric_limits<uint8_t>::max()
 The 'undefined' value for a 8-bit unsigned integer. More...
 
constexpr uint32_t UINT32_MASK = 0xFFFFFFFF
 The bitmask of 32-bit unsigned integer. More...
 
constexpr ulint ULINT_MAX = std::numeric_limits<ulint>::max() - 1
 Maximum value for a ulint. More...
 
constexpr ib_id_t IB_ID_MAX = std::numeric_limits<uint64_t>::max()
 
constexpr uint32_t UNIV_SQL_NULL = UINT32_UNDEFINED
 The following number as the length of a logical field means that the field has the SQL NULL as its value. More...
 
constexpr auto UNIV_SQL_ADD_COL_DEFAULT = UNIV_SQL_NULL - 1
 Flag to indicate a field which was added instantly. More...
 
constexpr auto UNIV_NO_INDEX_VALUE = UNIV_SQL_ADD_COL_DEFAULT - 1
 The following number as the length of a logical field means that no attribute value for the multi-value index exists in the JSON doc. More...
 
const uint32_t UNIV_MULTI_VALUE_ARRAY_MARKER = UNIV_NO_INDEX_VALUE - 1
 The following number as the length marker of a logical field, which is only used for multi-value field data, means the data itself of the field is actually an array. More...
 
constexpr auto UNIV_SQL_INSTANT_DROP_COL = UNIV_MULTI_VALUE_ARRAY_MARKER - 1
 Flag to indicate a field which was dropped instantly. More...
 
constexpr uint32_t UNIV_EXTERN_STORAGE_FIELD
 Lengths which are not UNIV_SQL_NULL, but bigger than the following number indicate that a field contains a reference to an externally stored part of the field in the tablespace. More...
 
ulong srv_page_size_shift
 
ulong srv_page_size
 
static const size_t UNIV_SECTOR_SIZE = 512
 
constexpr uint32_t SPDIMS = 2
 
static constexpr std::chrono::seconds PRINT_INTERVAL {10}
 If we are doing something that takes longer than this many seconds then print an informative message. More...
 

Detailed Description

Version control for database, common definitions, and include files.

Created 1/20/1994 Heikki Tuuri

Macro Definition Documentation

◆ _IB_TO_STR

#define _IB_TO_STR (   s)    #s

◆ IB_ID_FMT

#define IB_ID_FMT   UINT64PF

◆ IB_TO_STR

#define IB_TO_STR (   s)    _IB_TO_STR(s)

◆ IF_AHI_DEBUG

#define IF_AHI_DEBUG (   ...)    __VA_ARGS__

◆ IF_DEBUG

#define IF_DEBUG (   ...)    __VA_ARGS__

◆ IF_ENABLED

#define IF_ENABLED (   s,
  ... 
)
Value:
if (Sync_point::enabled((s))) { \
__VA_ARGS__ \
}
static bool enabled(const THD *thd, const std::string &target) noexcept
Check if a target is enabled.
Definition: sync0debug.cc:1732

◆ INNODB_DD_TABLE

#define INNODB_DD_TABLE (   name,
  n_indexes 
)     { name, n_indexes }

Hard-coded data dictionary entry.

◆ INNODB_VERSION_BUGFIX

#define INNODB_VERSION_BUGFIX   MYSQL_VERSION_PATCH

◆ INNODB_VERSION_MAJOR

#define INNODB_VERSION_MAJOR   MYSQL_VERSION_MAJOR

◆ INNODB_VERSION_MINOR

#define INNODB_VERSION_MINOR   MYSQL_VERSION_MINOR

◆ INNODB_VERSION_SHORT

#define INNODB_VERSION_SHORT   (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)

◆ INNODB_VERSION_STR

#define INNODB_VERSION_STR
Value:
#define INNODB_VERSION_MAJOR
Definition: univ.i:54
#define IB_TO_STR(s)
Definition: univ.i:52
#define INNODB_VERSION_BUGFIX
Definition: univ.i:56
#define INNODB_VERSION_MINOR
Definition: univ.i:55

◆ OS_PATH_SEPARATOR

#define OS_PATH_SEPARATOR   '/'

◆ OS_PATH_SEPARATOR_ALT

#define OS_PATH_SEPARATOR_ALT   '\\'

◆ OS_PATH_SEPARATOR_STR

#define OS_PATH_SEPARATOR_STR   "/"

◆ PAGE_ID_PF

#define PAGE_ID_PF   "page " SPACE_ID_PF ":" PAGE_NO_PF

◆ PAGE_NO_PF

#define PAGE_NO_PF   UINT32PF

◆ REFMAN

#define REFMAN
Value:
"http://dev.mysql.com/doc/refman/" IB_TO_STR( \
#define MYSQL_VERSION_MAJOR
Definition: config.h:299
#define MYSQL_VERSION_MINOR
Definition: config.h:300

◆ SPACE_ID_PF

#define SPACE_ID_PF   UINT32PF

◆ SPACE_ID_PFS

#define SPACE_ID_PFS   UINT32PFS

◆ UINT16PF

#define UINT16PF   "%" PRIu16

◆ UINT32PF

#define UINT32PF   "%" PRIu32

◆ UINT32PFS

#define UINT32PFS   PRIu32

◆ UINT64PF

#define UINT64PF   "%" PRIu64

◆ UINT64PFx

#define UINT64PFx   "%016" PRIx64

◆ ULINTPF

#define ULINTPF   "%" ULINTPFS

◆ ULINTPFS

#define ULINTPFS   "lu"

◆ UNIV_BTR_DEBUG

#define UNIV_BTR_DEBUG   /* check B-tree links */

◆ UNIV_COLD

#define UNIV_COLD   /* empty */

◆ UNIV_EXPECT

#define UNIV_EXPECT (   expr,
  value 
)    expr

◆ univ_i

#define univ_i

◆ UNIV_LIGHT_MEM_DEBUG

#define UNIV_LIGHT_MEM_DEBUG   /* light memory debugging */

◆ UNIV_LIKELY

#define UNIV_LIKELY (   cond)    UNIV_EXPECT(cond, true)

◆ UNIV_LIKELY_NULL

#define UNIV_LIKELY_NULL (   expr)    expr

◆ UNIV_MEM_ALLOC

#define UNIV_MEM_ALLOC (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_ASSERT_AND_ALLOC

#define UNIV_MEM_ASSERT_AND_ALLOC (   addr,
  size 
)
Value:
do { \
UNIV_MEM_ASSERT_W(addr, size); \
UNIV_MEM_ALLOC(addr, size); \
} while (0)
size_t size(const char *const c)
Definition: base64.h:46

◆ UNIV_MEM_ASSERT_AND_FREE

#define UNIV_MEM_ASSERT_AND_FREE (   addr,
  size 
)
Value:
do { \
UNIV_MEM_ASSERT_W(addr, size); \
UNIV_MEM_FREE(addr, size); \
} while (0)

◆ UNIV_MEM_ASSERT_RW

#define UNIV_MEM_ASSERT_RW (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_ASSERT_RW_ABORT

#define UNIV_MEM_ASSERT_RW_ABORT (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_ASSERT_RW_LOW

#define UNIV_MEM_ASSERT_RW_LOW (   addr,
  size,
  should_abort 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_ASSERT_W

#define UNIV_MEM_ASSERT_W (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_DESC

#define UNIV_MEM_DESC (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_FREE

#define UNIV_MEM_FREE (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_INVALID

#define UNIV_MEM_INVALID (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_TRASH

#define UNIV_MEM_TRASH (   addr,
  c,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_MEM_UNDESC

#define UNIV_MEM_UNDESC (   b)
Value:
do { \
} while (0)

◆ UNIV_MEM_VALID

#define UNIV_MEM_VALID (   addr,
  size 
)
Value:
do { \
} while (0)

◆ UNIV_NOTHROW

#define UNIV_NOTHROW

◆ UNIV_PAGE_SIZE

#define UNIV_PAGE_SIZE   ((ulint)srv_page_size)

The universal page size of the database.

◆ UNIV_PAGE_SIZE_SHIFT

#define UNIV_PAGE_SIZE_SHIFT   srv_page_size_shift

The 2-logarithm of UNIV_PAGE_SIZE:

◆ UNIV_PAGE_SSIZE_MAX

#define UNIV_PAGE_SSIZE_MAX    static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1)

Largest possible ssize for an uncompressed page.

(The convention 'ssize' is used for 'log2 minus 9' or the number of shifts starting with 512.) This max number varies depending on UNIV_PAGE_SIZE.

◆ UNIV_PAGE_SSIZE_MIN

#define UNIV_PAGE_SSIZE_MIN    static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT_MIN - UNIV_ZIP_SIZE_SHIFT_MIN + 1)

Smallest possible ssize for an uncompressed page.

◆ UNIV_PFS_IO

#define UNIV_PFS_IO

◆ UNIV_PFS_MEMORY

#define UNIV_PFS_MEMORY

◆ UNIV_PFS_MUTEX

#define UNIV_PFS_MUTEX

◆ UNIV_PFS_RWLOCK

#define UNIV_PFS_RWLOCK

◆ UNIV_PFS_THREAD

#define UNIV_PFS_THREAD

◆ UNIV_PREFETCH_R

#define UNIV_PREFETCH_R (   addr)    ((void)0)

◆ UNIV_PREFETCH_RW

#define UNIV_PREFETCH_RW (   addr)    ((void)0)

◆ UNIV_UNLIKELY

#define UNIV_UNLIKELY (   cond)    UNIV_EXPECT(cond, false)

◆ UT_ARR_SIZE

#define UT_ARR_SIZE (   a)    (sizeof(a) / sizeof((a)[0]))

Typedef Documentation

◆ byte

using byte = unsigned char

◆ Col_offsets_t

◆ ib_id_t

typedef uint64_t ib_id_t

The generic InnoDB system object identifier data type.

◆ lint

typedef long int lint

◆ os_thread_ret_t

typedef void* os_thread_ret_t

◆ page_no_t

typedef uint32_t page_no_t

Page number.

◆ space_id_t

typedef uint32_t space_id_t

Tablespace identifier.

◆ ulint

typedef unsigned long int ulint

Function Documentation

◆ call_destructor()

template<typename T >
void call_destructor ( T *  p)

Explicitly call the destructor, this is to get around Clang bug#12350.

Parameters
[in,out]pInstance on which to call the destructor

◆ to_int()

template<typename T >
constexpr auto to_int ( v) -> typename std::underlying_type<T>::type
constexpr

Variable Documentation

◆ FILENAME_CHARSET_MAXNAMLEN

constexpr uint32_t FILENAME_CHARSET_MAXNAMLEN = 5
constexpr

This is the "mbmaxlen" for my_charset_filename (defined in strings/ctype-utf8.c), which is used to encode File and Database names.

◆ IB_ID_MAX

constexpr ib_id_t IB_ID_MAX = std::numeric_limits<uint64_t>::max()
constexpr

◆ MAX_COMPRESSION_LEN

constexpr uint32_t MAX_COMPRESSION_LEN = 4
constexpr

Maximum length of the compression algorithm string.

Currently we support only (NONE | ZLIB | LZ4).

◆ MAX_DATABASE_NAME_LEN

constexpr uint32_t MAX_DATABASE_NAME_LEN = MAX_TABLE_NAME_LEN
constexpr

The maximum length of a database name.

Like MAX_TABLE_NAME_LEN this is the MySQL's NAME_LEN, see check_and_convert_db_name().

◆ MAX_FULL_NAME_LEN

constexpr uint32_t MAX_FULL_NAME_LEN
constexpr
Initial value:
=
constexpr uint32_t MAX_TABLE_NAME_LEN
The maximum length of an encode table name in bytes.
Definition: univ.i:358
constexpr uint32_t MAX_DATABASE_NAME_LEN
The maximum length of a database name.
Definition: univ.i:362

MAX_FULL_NAME_LEN defines the full name path including the database name and table name.

In addition, 14 bytes is added for: 2 for surrounding quotes around table name 1 for the separating dot (.) 9 for the mysql50# prefix

◆ MAX_TABLE_NAME_LEN

constexpr uint32_t MAX_TABLE_NAME_LEN = 320
constexpr

The maximum length of an encode table name in bytes.

The max table and database names are NAME_CHAR_LEN (64) characters. After the encoding, the max length would be NAME_CHAR_LEN (64) * FILENAME_CHARSET_MAXNAMLEN (5) = 320 bytes. The number does not include a terminating '\0'. InnoDB can handle longer names internally

◆ PRINT_INTERVAL

constexpr std::chrono::seconds PRINT_INTERVAL {10}
staticconstexpr

If we are doing something that takes longer than this many seconds then print an informative message.

◆ SPDIMS

constexpr uint32_t SPDIMS = 2
constexpr

◆ srv_page_size

ulong srv_page_size
extern

◆ srv_page_size_shift

ulong srv_page_size_shift
extern

◆ UINT16_UNDEFINED

constexpr uint16_t UINT16_UNDEFINED = std::numeric_limits<uint16_t>::max()
constexpr

The 'undefined' value for a 16-bit unsigned integer.

◆ UINT32_MASK

constexpr uint32_t UINT32_MASK = 0xFFFFFFFF
constexpr

The bitmask of 32-bit unsigned integer.

◆ UINT32_UNDEFINED

constexpr uint32_t UINT32_UNDEFINED = ~0U
constexpr

The 'undefined' value for a 32-bit unsigned integer.

◆ UINT64_UNDEFINED

constexpr uint64_t UINT64_UNDEFINED = ~0ULL
constexpr

The 'undefined' value for a 64-bit unsigned integer.

◆ UINT8_UNDEFINED

constexpr uint8_t UINT8_UNDEFINED = std::numeric_limits<uint8_t>::max()
constexpr

The 'undefined' value for a 8-bit unsigned integer.

◆ ULINT_MAX

constexpr ulint ULINT_MAX = std::numeric_limits<ulint>::max() - 1
constexpr

Maximum value for a ulint.

◆ ULINT_UNDEFINED

constexpr ulint ULINT_UNDEFINED = ~ulint{0U}
constexpr

The 'undefined' value for a ulint.

◆ ULONG_UNDEFINED

constexpr ulong ULONG_UNDEFINED = ~0UL
constexpr

◆ UNIV_EXTERN_STORAGE_FIELD

constexpr uint32_t UNIV_EXTERN_STORAGE_FIELD
constexpr
Initial value:
=
constexpr uint32_t UNIV_PAGE_SIZE_DEF
Default page size for InnoDB tablespaces.
Definition: univ.i:325
constexpr uint32_t UNIV_SQL_NULL
The following number as the length of a logical field means that the field has the SQL NULL as its va...
Definition: univ.i:463

Lengths which are not UNIV_SQL_NULL, but bigger than the following number indicate that a field contains a reference to an externally stored part of the field in the tablespace.

The length field then contains the sum of the following flag and the locally stored len.

◆ UNIV_MAX_PARALLELISM

constexpr uint32_t UNIV_MAX_PARALLELISM = 32
constexpr

Maximum number of parallel threads in a parallelized operation.

◆ UNIV_MEM_ALIGNMENT

constexpr uint32_t UNIV_MEM_ALIGNMENT = 8
constexpr

The following alignment is used in memory allocations in memory heap management to ensure correct alignment for doubles etc.

◆ UNIV_MULTI_VALUE_ARRAY_MARKER

const uint32_t UNIV_MULTI_VALUE_ARRAY_MARKER = UNIV_NO_INDEX_VALUE - 1

The following number as the length marker of a logical field, which is only used for multi-value field data, means the data itself of the field is actually an array.

◆ UNIV_NO_INDEX_VALUE

constexpr auto UNIV_NO_INDEX_VALUE = UNIV_SQL_ADD_COL_DEFAULT - 1
constexpr

The following number as the length of a logical field means that no attribute value for the multi-value index exists in the JSON doc.

◆ UNIV_PAGE_SIZE_DEF

constexpr uint32_t UNIV_PAGE_SIZE_DEF = 1 << UNIV_PAGE_SIZE_SHIFT_DEF
constexpr

Default page size for InnoDB tablespaces.

◆ UNIV_PAGE_SIZE_MAX

constexpr size_t UNIV_PAGE_SIZE_MAX = 1 << UNIV_PAGE_SIZE_SHIFT_MAX
constexpr

Maximum page size InnoDB currently supports.

◆ UNIV_PAGE_SIZE_MIN

constexpr uint32_t UNIV_PAGE_SIZE_MIN = 1 << UNIV_PAGE_SIZE_SHIFT_MIN
constexpr

Minimum page size InnoDB currently supports.

◆ UNIV_PAGE_SIZE_ORIG

constexpr uint32_t UNIV_PAGE_SIZE_ORIG = 1 << UNIV_PAGE_SIZE_SHIFT_ORIG
constexpr

Original 16k page size for InnoDB tablespaces.

◆ UNIV_PAGE_SIZE_SHIFT_DEF

constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_DEF = 14
constexpr

Default Page Size Shift (power of 2)

◆ UNIV_PAGE_SIZE_SHIFT_MAX

constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_MAX = 16
constexpr

Maximum Page Size Shift (power of 2)

◆ UNIV_PAGE_SIZE_SHIFT_MIN

constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_MIN = 12
constexpr

Minimum Page Size Shift (power of 2)

◆ UNIV_PAGE_SIZE_SHIFT_ORIG

constexpr uint32_t UNIV_PAGE_SIZE_SHIFT_ORIG = 14
constexpr

Original 16k InnoDB Page Size Shift, in case the default changes.

◆ UNIV_PAGE_SSIZE_ORIG

constexpr uint32_t UNIV_PAGE_SSIZE_ORIG = UNIV_PAGE_SIZE_SHIFT_ORIG - 9
constexpr

Original 16k InnoDB Page Size as an ssize (log2 - 9)

◆ UNIV_SECTOR_SIZE

const size_t UNIV_SECTOR_SIZE = 512
static

◆ UNIV_SQL_ADD_COL_DEFAULT

constexpr auto UNIV_SQL_ADD_COL_DEFAULT = UNIV_SQL_NULL - 1
constexpr

Flag to indicate a field which was added instantly.

◆ UNIV_SQL_INSTANT_DROP_COL

constexpr auto UNIV_SQL_INSTANT_DROP_COL = UNIV_MULTI_VALUE_ARRAY_MARKER - 1
constexpr

Flag to indicate a field which was dropped instantly.

◆ UNIV_SQL_NULL

constexpr uint32_t UNIV_SQL_NULL = UINT32_UNDEFINED
constexpr

The following number as the length of a logical field means that the field has the SQL NULL as its value.

NOTE that because we assume that the length of a field is a 32-bit integer when we store it, for example, to an undo log on disk, we must have also this number fit in 32 bits, also in 64-bit computers!

◆ UNIV_WORD_SIZE

constexpr size_t UNIV_WORD_SIZE = SIZEOF_LONG
constexpr

MySQL config.h generated by CMake will define SIZEOF_LONG in Posix.

◆ UNIV_ZIP_SIZE_MAX

constexpr uint32_t UNIV_ZIP_SIZE_MAX = 1 << UNIV_ZIP_SIZE_SHIFT_MAX
constexpr

Largest compressed page size.

◆ UNIV_ZIP_SIZE_MIN

constexpr uint32_t UNIV_ZIP_SIZE_MIN = 1 << UNIV_ZIP_SIZE_SHIFT_MIN
constexpr

Smallest compressed page size.

◆ UNIV_ZIP_SIZE_SHIFT_MAX

constexpr uint32_t UNIV_ZIP_SIZE_SHIFT_MAX = 14
constexpr

log2 of largest compressed page size (1<<14 == 16384 bytes).

A compressed page directory entry reserves 14 bits for the start offset and 2 bits for flags. This limits the uncompressed page size to 16k. Even though a 16k uncompressed page can theoretically be compressed into a larger compressed page, it is not a useful feature so we will limit both with this same constant.

◆ UNIV_ZIP_SIZE_SHIFT_MIN

constexpr uint32_t UNIV_ZIP_SIZE_SHIFT_MIN = 10
constexpr

log2 of smallest compressed page size (1<<10 == 1024 bytes) Note: This must never change!