MySQL 9.1.0
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 <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... | |
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... | |
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 |
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 |
Max value for an unsigned integer of 'bits' bits.
The somewhat contorted expression is to avoid overflow.