![]() |
MySQL 8.0.43
Source Code Documentation
|
Various utilities for Innobase. More...
#include "my_config.h"#include <errno.h>#include <time.h>#include <string>#include "ha_prototypes.h"#include <mysql_com.h>#include "my_compiler.h"#include "os0thread.h"#include "ut0ut.h"#include "sql/log.h"#include "trx0trx.h"#include "clone0api.h"#include "mysql/components/services/log_builtins.h"#include "sql/derror.h"Namespaces | |
| namespace | ut |
| This file contains a set of libraries providing overloads for regular dynamic allocation routines which allow for opt-in memory instrumentation through performance schema memory engine (PFS). | |
| namespace | ib |
Functions | |
| ulint | ut_delay (ulint delay) |
| Runs an idle loop on CPU. More... | |
| ulint | ut_2_power_up (ulint n) |
| Calculates fast the number rounded up to the nearest power of 2. More... | |
| std::string | ut_get_name (const trx_t *trx, const char *name) |
| Get a fixed-length string, quoted as an SQL identifier. More... | |
| void | ut_print_name (FILE *f, const trx_t *trx, const char *name) |
| Outputs a fixed-length string, quoted as an SQL identifier. More... | |
| char * | ut_format_name (const char *name, char *formatted, ulint formatted_size) |
| Format a table name, quoted as an SQL identifier. More... | |
| void | ut_copy_file (FILE *dest, FILE *src) |
| Catenate files. More... | |
| void | ut_format_byte_value (uint64_t data_bytes, std::string &data_str) |
| Convert byte value to string with unit. More... | |
| const char * | ut_strerr (dberr_t num) |
| Convert an error number to a human readable text message. More... | |
Various utilities for Innobase.
Created 5/11/1994 Heikki Tuuri
Calculates fast the number rounded up to the nearest power of 2.
| n | in: number != 0 |
| void ut_copy_file | ( | FILE * | dest, |
| FILE * | src | ||
| ) |
Catenate files.
| [in] | dest | Output file |
| [in] | src | Input file to be appended to output |
Runs an idle loop on CPU.
The argument gives the desired delay in microseconds on 100 MHz Pentium + Visual C++. The actual duration depends on a product of delay and the current value of @innodb_spin_wait_pause_multiplier.
| [in] | delay | delay in microseconds on 100 MHz Pentium, assuming spin_wait_pause_multiplier is 50 (default). |
| void ut_format_byte_value | ( | uint64_t | data_bytes, |
| std::string & | data_str | ||
| ) |
Convert byte value to string with unit.
| [in] | data_bytes | byte value |
| [out] | data_str | formatted string |
| char * ut_format_name | ( | const char * | name, |
| char * | formatted, | ||
| ulint | formatted_size | ||
| ) |
Format a table name, quoted as an SQL identifier.
If the name contains a slash '/', the result will contain two identifiers separated by a period (.), as in SQL database_name.table_name.
| [in] | name | table or index name |
| [out] | formatted | formatted result, will be NUL-terminated |
| [in] | formatted_size | size of the buffer in bytes |
| std::string ut_get_name | ( | const trx_t * | trx, |
| const char * | name | ||
| ) |
Get a fixed-length string, quoted as an SQL identifier.
If the string contains a slash '/', the string will be output as two identifiers separated by a period (.), as in SQL database_name.identifier.
| [in] | trx | transaction (NULL=no quotes). |
| [in] | name | table name. |
| String | quoted as an SQL identifier. |
| void ut_print_name | ( | FILE * | f, |
| const trx_t * | trx, | ||
| const char * | name | ||
| ) |
Outputs a fixed-length string, quoted as an SQL identifier.
If the string contains a slash '/', the string will be output as two identifiers separated by a period (.), as in SQL database_name.identifier.
| f | in: output stream |
| trx | in: transaction |
| name | in: name to print |
| const char * ut_strerr | ( | dberr_t | num | ) |
Convert an error number to a human readable text message.
The returned string is static and should not be freed or modified.
| [in] | num | InnoDB internal error number |