![]() |
MySQL 8.4.13
Source Code Documentation
|
#include "mysql/binlog/event/export/binary_log_funcs.h"#include "field_types.h"#include "my_time.h"#include "mysql/binlog/event/byteorder.h"#include "mysql/binlog/event/wrapper_functions.h"#include <stdint.h>#include <string.h>#include <climits>#include <cstddef>#include <cstring>Functions | |
| static unsigned int | uint_max (int bits) |
| Max value for an unsigned integer of 'bits' bits. More... | |
| unsigned int | my_time_binary_length (unsigned int dec) |
| Calculate binary size of packed numeric time representation. More... | |
| unsigned int | my_datetime_binary_length (unsigned int dec) |
| Calculate binary size of packed datetime representation. More... | |
| unsigned int | my_timestamp_binary_length (unsigned int dec) |
| Calculate on-disk size of a timestamp value. More... | |
| unsigned int | max_display_length_for_field (enum_field_types sql_type, unsigned int metadata) |
| Compute the maximum display length of a field. More... | |
| int | decimal_binary_size (int precision, int scale) |
| Returns the size of array to hold a binary representation of a decimal. More... | |
| static enum_calc_field_size_status | read_field_length (const unsigned char *master_data, uint32_t length_bytes, size_t available, bool check_bounds, uint32_t *length) |
| static enum_calc_field_size_status | add_to_field_length (uint32_t add, bool check_bounds, uint32_t *length) |
| static enum_calc_field_size_status | calc_field_size_internal (unsigned char col, const unsigned char *master_data, unsigned int metadata, size_t available, bool check_bounds, uint32_t *field_size) |
| uint32_t | calc_field_size (unsigned char col, const unsigned char *master_data, unsigned int metadata) |
| This helper function calculates the size in bytes of a particular field in a row type event as defined by the field_ptr and metadata_ptr arguments. More... | |
| enum enum_calc_field_size_status | calc_field_size_checked (unsigned char col, const unsigned char *master_data, unsigned int metadata, size_t available, uint32_t *field_size) |
| This helper function calculates the size in bytes of a particular field in a row type event, after checking that all bytes read from master_data fit in the available input. More... | |
|
static |
| uint32_t calc_field_size | ( | unsigned char | col, |
| const unsigned char * | master_data, | ||
| unsigned int | metadata | ||
| ) |
This helper function calculates the size in bytes of a particular field in a row type event as defined by the field_ptr and metadata_ptr arguments.
| col | Field type code |
| master_data | The field data |
| metadata | The field metadata |
| enum enum_calc_field_size_status calc_field_size_checked | ( | unsigned char | col, |
| const unsigned char * | master_data, | ||
| unsigned int | metadata, | ||
| size_t | available, | ||
| uint32_t * | field_size | ||
| ) |
This helper function calculates the size in bytes of a particular field in a row type event, after checking that all bytes read from master_data fit in the available input.
| col | Field type code |
| master_data | The field data |
| metadata | The field metadata |
| available | Number of bytes available from master_data |
| field_size | The size in bytes of the field, on success |
| CALC_FIELD_SIZE_OK | The field size was calculated successfully. |
| CALC_FIELD_SIZE_TRUNCATED | The field length prefix or value exceeds the available input. |
| CALC_FIELD_SIZE_INVALID_TYPE | The field type or metadata is invalid. |
|
static |
| int decimal_binary_size | ( | int | precision, |
| int | scale | ||
| ) |
Returns the size of array to hold a binary representation of a decimal.
| precision | number of significant digits in a particular radix R where R is either 2 or 10. |
| scale | to what position to round. |
| unsigned int max_display_length_for_field | ( | enum_field_types | sql_type, |
| unsigned int | metadata | ||
| ) |
Compute the maximum display length of a field.
| sql_type | Type of the field |
| metadata | The metadata from the master for the field. |
| unsigned int my_datetime_binary_length | ( | unsigned int | dec | ) |
Calculate binary size of packed datetime representation.
| dec | Precision. |
The same formula is used to find the binary size of the packed numeric time in libbinlogevents/src/value.cpp calc_field_size(). If any modification is done here the same needs to be done in the aforementioned method in libbinlogevents also.
| unsigned int my_time_binary_length | ( | unsigned int | dec | ) |
Calculate binary size of packed numeric time representation.
| dec | Precision. The same formula is used to find the binary size of the packed numeric time in libbinlogevents/src/value.cpp calc_field_size(). If any modification is done here the same needs to be done in the aforementioned method in libbinlogevents also. |
| unsigned int my_timestamp_binary_length | ( | unsigned int | dec | ) |
Calculate on-disk size of a timestamp value.
| dec | Precision. |
The same formula is used to find the binary size of the packed numeric time in libbinlogevents/src/value.cpp calc_field_size(). If any modification is done here the same needs to be done in the aforementioned method in libbinlogevents also.
|
static |
|
static |
Max value for an unsigned integer of 'bits' bits.
The somewhat contorted expression is to avoid overflow.