MySQL  8.0.17
Source Code Documentation
Mysys - low level utilities for MySQL

Modules

 Mysys time utilities
 

Files

file  my_sys.h
 Common header for many mysys elements.
 

Classes

struct  st_my_file_info
 
struct  DYNAMIC_ARRAY
 
struct  MY_TMPDIR
 
struct  DYNAMIC_STRING
 
struct  IO_CACHE_SHARE
 
struct  IO_CACHE
 
struct  ST_FILE_ID
 
struct  USED_MEM
 struct for once_alloc (block) More...
 

Macros

#define MY_INIT(name)
 
#define MYSYS_ERRMSG_SIZE   (512)
 Max length of an error message generated by mysys utilities. More...
 
#define MYSYS_STRERROR_SIZE   (128)
 
#define MY_FILE_ERROR   ((size_t)-1)
 
#define MY_FFNF   1 /* Fatal if file not found */
 
#define MY_FNABP   2 /* Fatal if not all bytes read/writen */
 
#define MY_NABP   4 /* Error if not all bytes read/writen */
 
#define MY_FAE   8 /* Fatal if any error */
 
#define MY_WME   16 /* Write message on error */
 
#define MY_WAIT_IF_FULL   32 /* Wait and try again if disk full error */
 
#define MY_IGNORE_BADFD   32 /* my_sync: ignore 'bad descriptor' errors */
 
#define MY_SYNC_DIR   8192 /* my_create/delete/rename: sync directory */
 
#define MY_REPORT_WAITING_IF_FULL   64 /* my_write: set status as waiting */
 
#define MY_FULL_IO   512 /* For my_read - loop intil I/O is complete */
 
#define MY_DONT_CHECK_FILESIZE   128 /* Option to init_io_cache() */
 
#define MY_LINK_WARNING   32 /* my_redel() gives warning if links */
 
#define MY_COPYTIME   64 /* my_redel() copys time */
 
#define MY_DELETE_OLD   256 /* my_create_with_symlink() */
 
#define MY_RESOLVE_LINK   128 /* my_realpath(); Only resolve links */
 
#define MY_HOLD_ORIGINAL_MODES   128 /* my_copy() holds to file modes */
 
#define MY_SEEK_NOT_DONE   32 /* my_lock may have to do a seek */
 
#define MY_DONT_WAIT   64 /* my_lock() don't wait if can't lock */
 
#define MY_ZEROFILL   32 /* my_malloc(), fill array with zero */
 
#define MY_ALLOW_ZERO_PTR   64 /* my_realloc() ; zero ptr -> malloc */
 
#define MY_FREE_ON_ERROR   128 /* my_realloc() ; Free old ptr on error */
 
#define MY_HOLD_ON_ERROR   256 /* my_realloc() ; Return old ptr on error */
 
#define MY_DONT_OVERWRITE_FILE   1024 /* my_copy: Don't overwrite file */
 
#define MY_THREADSAFE   2048 /* my_seek(): lock fd mutex */
 
#define MY_SYNC   4096 /* my_copy(): sync dst file */
 
#define MYF_RW   MYF(MY_WME + MY_NABP) /* For my_read & my_write */
 
#define MY_CHECK_ERROR   1 /* Params to my_end; Check open-close */
 
#define MY_GIVE_INFO   2 /* Give time info about process*/
 
#define MY_DONT_FREE_DBUG   4 /* Do not call DBUG_END() in my_end() */
 
#define ME_BELL   4 /* DEPRECATED: Ring bell then printing message */
 
#define ME_ERRORLOG   64 /* Write the error message to error log */
 
#define ME_FATALERROR   1024 /* Fatal statement error */
 
#define MY_REPLACE_DIR   1 /* replace dir in name with 'dir' */
 
#define MY_REPLACE_EXT   2 /* replace extension with 'ext' */
 
#define MY_UNPACK_FILENAME   4 /* Unpack name (~ -> home) */
 
#define MY_RESOLVE_SYMLINKS   16 /* Resolve all symbolic links */
 
#define MY_RETURN_REAL_PATH   32 /* return full path for file */
 
#define MY_SAFE_PATH   64 /* Return NULL if too long path */
 
#define MY_RELATIVE_PATH   128 /* name is relative to 'dir' */
 
#define MY_APPEND_EXT   256 /* add 'ext' as additional extension*/
 
#define MY_SEEK_SET   0
 
#define MY_SEEK_CUR   1
 
#define MY_SEEK_END   2
 
#define MY_WAIT_FOR_USER_TO_FIX_PANIC   60 /* in seconds */
 
#define MY_WAIT_GIVE_USER_A_MESSAGE   10 /* Every 10 times of prev */
 
#define MIN_COMPRESS_LENGTH   50 /* Don't compress small bl. */
 
#define DFLT_INIT_HITS   3
 
#define MY_KEEP_PREALLOC   1
 
#define MY_MARK_BLOCKS_FREE   2 /* move used to free list and reuse them */
 
#define MY_ERRNO_EDOM   33
 
#define MY_ERRNO_ERANGE   34
 
#define my_safe_alloca(size, max_alloca_sz)
 
#define my_safe_afree(ptr, size, max_alloca_sz)   if (size > max_alloca_sz) my_free(ptr)
 
#define DEBUG_SYNC_C(_sync_point_name_)
 
#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_)
 
#define my_get_large_page_size()   (0)
 
#define my_alloca(SZ)   alloca((size_t)(SZ))
 
#define MY_ALL_CHARSETS_SIZE   2048
 
#define MALLOC_OVERHEAD   8
 
#define RECORD_CACHE_SIZE   (uint)(64 * 1024 - MALLOC_OVERHEAD)
 
#define MAX_SYSLOG_MESSAGE_SIZE   1024
 
#define my_access   access
 
#define is_filename_allowed(name, length, allow_cwd)   (true)
 
#define my_delete_allow_opened(fname, flags)   my_delete((fname), (flags))
 
#define my_print_open_files()
 
#define base_name(A)   (A + dirname_length(A))
 
#define flush_io_cache(info)   my_b_flush_io_cache((info), 1)
 
#define dynamic_element(array, array_index, type)   ((type)((array)->buffer) + (array_index))
 
#define alloc_root_inited(A)   ((A)->inited())
 
#define PROT_READ   1
 
#define PROT_WRITE   2
 
#define MAP_NORESERVE   0
 
#define MAP_SHARED   0x0001
 
#define MAP_PRIVATE   0x0002
 
#define MAP_NOSYNC   0x0800
 
#define MAP_FAILED   ((void *)-1)
 
#define MS_SYNC   0x0000
 

Typedefs

typedef int(* IO_CACHE_CALLBACK) (IO_CACHE *)
 
typedef int(* qsort2_cmp) (const void *, const void *, const void *)
 
typedef void(* my_error_reporter) (enum loglevel level, uint ecode,...)
 
typedef uint32 ha_checksum
 

Enumerations

enum  cache_type {
  TYPE_NOT_SET = 0, READ_CACHE, WRITE_CACHE, SEQ_READ_APPEND,
  READ_FIFO, READ_NET, WRITE_NET
}
 
enum  flush_type { FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE }
 
enum  file_type {
  UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN,
  STREAM_BY_FDOPEN, FILE_BY_MKSTEMP, FILE_BY_O_TMPFILE
}
 
enum  my_syslog_options { MY_SYSLOG_PIDS = 1 }
 
enum  UnlinkOrKeepFile { UNLINK_FILE, KEEP_FILE }
 

Functions

void * my_multi_malloc (PSI_memory_key key, myf flags,...)
 
void my_b_clear (IO_CACHE *info)
 
bool my_b_inited (const IO_CACHE *info)
 
int my_b_read (IO_CACHE *info, uchar *buffer, size_t count)
 
int my_b_write (IO_CACHE *info, const uchar *buffer, size_t count)
 
int _my_b_get (IO_CACHE *info)
 
int my_b_get (IO_CACHE *info)
 
my_off_t my_b_tell (const IO_CACHE *info)
 
ucharmy_b_get_buffer_start (const IO_CACHE *info)
 
size_t my_b_get_bytes_in_buffer (const IO_CACHE *info)
 
my_off_t my_b_get_pos_in_file (const IO_CACHE *info)
 
int my_b_copy_to_file (IO_CACHE *cache, FILE *file)
 
size_t my_b_bytes_in_cache (const IO_CACHE *info)
 
int my_copy (const char *from, const char *to, myf MyFlags)
 
int my_delete (const char *name, myf MyFlags)
 
int my_getwd (char *buf, size_t size, myf MyFlags)
 
int my_setwd (const char *dir, myf MyFlags)
 
void * my_once_alloc (size_t Size, myf MyFlags)
 
void my_once_free (void)
 
char * my_once_strdup (const char *src, myf myflags)
 
void * my_once_memdup (const void *src, size_t len, myf myflags)
 
File my_open (const char *FileName, int Flags, myf MyFlags)
 
File my_register_filename (File fd, const char *FileName, enum file_type type_of_file, uint error_message_number, myf MyFlags)
 
File my_create (const char *FileName, int CreateFlags, int AccessFlags, myf MyFlags)
 
int my_close (File Filedes, myf MyFlags)
 
int my_mkdir (const char *dir, int Flags, myf MyFlags)
 
int my_readlink (char *to, const char *filename, myf MyFlags)
 
int my_is_symlink (const char *filename, ST_FILE_ID *file_id)
 
int my_realpath (char *to, const char *filename, myf MyFlags)
 
int my_is_same_file (File file, const ST_FILE_ID *file_id)
 Return non-zero if the file descriptor and a previously lstat-ed file identified by file_id point to the same file. More...
 
File my_create_with_symlink (const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags)
 
int my_delete_with_symlink (const char *name, myf MyFlags)
 
int my_rename_with_symlink (const char *from, const char *to, myf MyFlags)
 
int my_symlink (const char *content, const char *linkname, myf MyFlags)
 
size_t my_read (File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
 Read a chunk of bytes from a file with retry's if needed If flag MY_FULL_IO is set then keep reading until EOF is found. More...
 
size_t my_pread (File Filedes, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
 
int my_rename (const char *from, const char *to, myf MyFlags)
 
my_off_t my_seek (File fd, my_off_t pos, int whence, myf MyFlags)
 
my_off_t my_tell (File fd, myf MyFlags)
 
size_t my_write (File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
 Write a chunk of bytes to a file. More...
 
size_t my_pwrite (File Filedes, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
 Write a chunk of bytes to a file at a given position. More...
 
size_t my_fread (FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
 
size_t my_fwrite (FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
 
my_off_t my_fseek (FILE *stream, my_off_t pos, int whence)
 
my_off_t my_ftell (FILE *stream)
 
int my_openlog (const char *eventSourceName, int option, int facility)
 Opens/Registers a new handle for system logging. More...
 
int my_closelog ()
 Closes/de-registers the system logging handle. More...
 
int my_syslog (const CHARSET_INFO *cs, enum loglevel level, const char *msg)
 Sends message to the system logger. More...
 
int check_if_legal_filename (const char *path)
 
int check_if_legal_tablename (const char *path)
 
const char * get_global_errmsg (int nr)
 
void wait_for_free_space (const char *filename, int errors)
 
FILE * my_fopen (const char *FileName, int Flags, myf MyFlags)
 
FILE * my_fdopen (File Filedes, const char *name, int Flags, myf MyFlags)
 
FILE * my_freopen (const char *path, const char *mode, FILE *stream)
 Change the file associated with a file stream. More...
 
int my_fclose (FILE *fd, myf MyFlags)
 
File my_fileno (FILE *fd)
 
int my_chsize (File fd, my_off_t newlength, int filler, myf MyFlags)
 
int my_fallocator (File fd, my_off_t newlength, int filler, myf MyFlags)
 Change size of the specified file. More...
 
void thr_set_sync_wait_callback (void(*before_sync)(void), void(*after_sync)(void))
 
int my_sync (File fd, myf my_flags)
 
int my_sync_dir (const char *dir_name, myf my_flags)
 
int my_sync_dir_by_file (const char *file_name, myf my_flags)
 
char * my_strerror (char *buf, size_t len, int errnum)
 Get a string describing a system or handler error. More...
 
const char * my_get_err_msg (int nr)
 Get an error format string from one of the my_error_register()ed sets. More...
 
void my_error (int nr, myf MyFlags,...)
 Fill in and print a previously registered error message. More...
 
void my_printf_error (uint my_err, const char *format, myf MyFlags,...)
 Print an error message. More...
 
void my_printv_error (uint error, const char *format, myf MyFlags, va_list ap)
 Print an error message. More...
 
int my_error_register (const char *(*get_errmsg)(int), int first, int last)
 Register error messages for use with my_error(). More...
 
bool my_error_unregister (int first, int last)
 Unregister formerly registered error messages. More...
 
void my_message (uint my_err, const char *str, myf MyFlags)
 Print an error message. More...
 
void my_message_stderr (uint my_err, const char *str, myf MyFlags)
 Print an error message on stderr. More...
 
void my_message_local_stderr (enum loglevel, uint ecode, va_list args)
 Issue a message locally (i.e. More...
 
void my_message_local (enum loglevel ll, uint ecode,...)
 Issue a message locally (i.e. More...
 
bool my_init (void)
 Initialize my_sys functions, resources and variables. More...
 
void my_end (int infoflag)
 
const char * my_filename (File fd)
 
MY_MODE get_file_perm (ulong perm_flags)
 
bool my_chmod (const char *filename, ulong perm_flags, myf my_flags)
 
bool init_tmpdir (MY_TMPDIR *tmpdir, const char *pathlist)
 
char * my_tmpdir (MY_TMPDIR *tmpdir)
 
void free_tmpdir (MY_TMPDIR *tmpdir)
 
size_t dirname_part (char *to, const char *name, size_t *to_res_length)
 Gives directory part of filename. More...
 
size_t dirname_length (const char *name)
 Get the string length of the directory part of name, including the last FN_LIBCHAR. More...
 
int test_if_hard_path (const char *dir_name)
 
bool has_path (const char *name)
 
char * convert_dirname (char *to, const char *from, const char *from_end)
 Convert directory name to use under this system. More...
 
void to_unix_path (char *name)
 Convert filename to unix style filename. More...
 
char * fn_ext (char *name)
 
const char * fn_ext (const char *name)
 
char * fn_same (char *toname, const char *name, int flag)
 
char * fn_format (char *to, const char *name, const char *dir, const char *form, uint flag)
 Formats a filename with possible replace of directory of extension Function can handle the case where 'to' == 'name' For a description of the flag values, consult my_sys.h The arguments should be in unix format. More...
 
size_t strlength (const char *str)
 Calculate the length of str not including any trailing ' '-bytes. More...
 
size_t normalize_dirname (char *to, const char *from)
 Convert a directory name to a format which can be compared as strings. More...
 
size_t unpack_dirname (char *to, const char *from)
 Fixes a directory name so that can be used by open(). More...
 
size_t cleanup_dirname (char *to, const char *from)
 
Remove unwanted chars from dirname. More...
 
size_t system_filename (char *to, const char *from)
 Convert filename (unix standard) to system standard Used before system command's like open(), create() More...
 
size_t unpack_filename (char *to, const char *from)
 Fix filename so it can be used by open, create. More...
 
char * intern_filename (char *to, const char *from)
 Fix a filename to intern (UNIX format). More...
 
char * my_path (char *to, const char *progname, const char *own_pathname_part)
 
char * my_load_path (char *to, const char *path, const char *own_path_prefix)
 Returns full load-path for a file. More...
 
bool array_append_string_unique (const char *str, const char **array, size_t size)
 Append str to array, or move to the end if it already exists. More...
 
void my_store_ptr (uchar *buff, size_t pack_length, my_off_t pos)
 
my_off_t my_get_ptr (uchar *ptr, size_t pack_length)
 
int init_io_cache_ext (IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, bool use_async_io, myf cache_myflags, PSI_file_key file_key)
 
int init_io_cache (IO_CACHE *info, File file, size_t cachesize, enum cache_type type, my_off_t seek_offset, bool use_async_io, myf cache_myflags)
 
bool reinit_io_cache (IO_CACHE *info, enum cache_type type, my_off_t seek_offset, bool use_async_io, bool clear_cache)
 
void setup_io_cache (IO_CACHE *info)
 
int _my_b_read (IO_CACHE *info, uchar *Buffer, size_t Count)
 
int _my_b_read_r (IO_CACHE *info, uchar *Buffer, size_t Count)
 
void init_io_cache_share (IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, IO_CACHE *write_cache, uint num_threads)
 
void remove_io_thread (IO_CACHE *info)
 
int _my_b_seq_read (IO_CACHE *info, uchar *Buffer, size_t Count)
 
int _my_b_net_read (IO_CACHE *info, uchar *Buffer, size_t Count)
 Read buffered from the net. More...
 
int _my_b_write (IO_CACHE *info, const uchar *Buffer, size_t Count)
 
int my_b_append (IO_CACHE *info, const uchar *Buffer, size_t Count)
 
int my_b_safe_write (IO_CACHE *info, const uchar *Buffer, size_t Count)
 
int my_block_write (IO_CACHE *info, const uchar *Buffer, size_t Count, my_off_t pos)
 
int my_b_flush_io_cache (IO_CACHE *info, int need_append_buffer_lock)
 
int end_io_cache (IO_CACHE *info)
 
size_t my_b_fill (IO_CACHE *info)
 
void my_b_seek (IO_CACHE *info, my_off_t pos)
 
size_t my_b_gets (IO_CACHE *info, char *to, size_t max_length)
 
my_off_t my_b_filelength (IO_CACHE *info)
 
size_t my_b_printf (IO_CACHE *info, const char *fmt,...)
 Simple printf version. More...
 
size_t my_b_vprintf (IO_CACHE *info, const char *fmt, va_list ap)
 Implementation of my_b_printf. More...
 
bool open_cached_file (IO_CACHE *cache, const char *dir, const char *prefix, size_t cache_size, myf cache_myflags)
 
bool real_open_cached_file (IO_CACHE *cache)
 
void close_cached_file (IO_CACHE *cache)
 
File create_temp_file (char *to, const char *dir, const char *pfx, int mode, UnlinkOrKeepFile unlink_or_keep, myf MyFlags)
 
bool my_init_dynamic_array (DYNAMIC_ARRAY *array, PSI_memory_key key, uint element_size, void *init_buffer, uint init_alloc, uint alloc_increment)
 
bool insert_dynamic (DYNAMIC_ARRAY *array, const void *element)
 
void * alloc_dynamic (DYNAMIC_ARRAY *array)
 
void * pop_dynamic (DYNAMIC_ARRAY *)
 
void claim_dynamic (DYNAMIC_ARRAY *array)
 
void delete_dynamic (DYNAMIC_ARRAY *array)
 
void freeze_size (DYNAMIC_ARRAY *array)
 
static void reset_dynamic (DYNAMIC_ARRAY *array)
 
bool init_dynamic_string (DYNAMIC_STRING *str, const char *init_str, size_t init_alloc, size_t alloc_increment)
 
bool dynstr_append (DYNAMIC_STRING *str, const char *append)
 
bool dynstr_append_mem (DYNAMIC_STRING *str, const char *append, size_t length)
 
bool dynstr_append_os_quoted (DYNAMIC_STRING *str, const char *append,...)
 
bool dynstr_set (DYNAMIC_STRING *str, const char *init_str)
 
bool dynstr_realloc (DYNAMIC_STRING *str, size_t additional_size)
 
bool dynstr_trunc (DYNAMIC_STRING *str, size_t n)
 
void dynstr_free (DYNAMIC_STRING *str)
 
void * multi_alloc_root (MEM_ROOT *mem_root,...)
 
char * strdup_root (MEM_ROOT *root, const char *str)
 
char * safe_strdup_root (MEM_ROOT *root, const char *str)
 
char * strmake_root (MEM_ROOT *root, const char *str, size_t len)
 
void * memdup_root (MEM_ROOT *root, const void *str, size_t len)
 
bool my_compress (uchar *, size_t *, size_t *)
 
bool my_uncompress (uchar *, size_t, size_t *)
 
ucharmy_compress_alloc (const uchar *packet, size_t *len, size_t *complen)
 
ha_checksum my_checksum (ha_checksum crc, const uchar *mem, size_t count)
 
uint my_set_max_open_files (uint files)
 
void my_free_open_file_info (void)
 
bool my_gethwaddr (uchar *to)
 
void * my_mmap (void *, size_t, int, int, int, my_off_t)
 
int my_munmap (void *, size_t)
 
static int my_getpagesize ()
 
int my_msync (int, void *, size_t, int)
 
void my_charset_loader_init_mysys (MY_CHARSET_LOADER *loader)
 Initialize character set loader to use mysys memory management functions. More...
 
uint get_charset_number (const char *cs_name, uint cs_flags)
 
uint get_collation_number (const char *name)
 
const char * get_charset_name (uint cs_number)
 
CHARSET_INFOget_charset (uint cs_number, myf flags)
 
CHARSET_INFOget_charset_by_name (const char *cs_name, myf flags)
 
CHARSET_INFOmy_collation_get_by_name (MY_CHARSET_LOADER *loader, const char *name, myf flags)
 Find collation by name: extended version of get_charset_by_name() to return error messages to the caller. More...
 
CHARSET_INFOget_charset_by_csname (const char *cs_name, uint cs_flags, myf my_flags)
 
CHARSET_INFOmy_charset_get_by_name (MY_CHARSET_LOADER *loader, const char *name, uint cs_flags, myf my_flags)
 Find character set by name: extended version of get_charset_by_csname() to return error messages to the caller. More...
 
bool resolve_charset (const char *cs_name, const CHARSET_INFO *default_cs, const CHARSET_INFO **cs)
 Resolve character set by the character set name (utf8, latin1, ...). More...
 
bool resolve_collation (const char *cl_name, const CHARSET_INFO *default_cl, const CHARSET_INFO **cl)
 Resolve collation by the collation name (utf8_general_ci, ...). More...
 
char * get_charsets_dir (char *buf)
 
bool my_charset_same (const CHARSET_INFO *cs1, const CHARSET_INFO *cs2)
 
bool init_compiled_charsets (myf flags)
 
void add_compiled_collation (CHARSET_INFO *cs)
 
size_t escape_string_for_mysql (const CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length)
 
void charset_uninit ()
 
size_t escape_quotes_for_mysql (CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length, char quote)
 
void my_init_mysys_psi_keys (void)
 
void set_psi_cond_service (void *psi)
 
void set_psi_data_lock_service (void *psi)
 
void set_psi_error_service (void *psi)
 
void set_psi_file_service (void *psi)
 
void set_psi_idle_service (void *psi)
 
void set_psi_mdl_service (void *psi)
 
void set_psi_memory_service (void *psi)
 
void set_psi_mutex_service (void *psi)
 
void set_psi_rwlock_service (void *psi)
 
void set_psi_socket_service (void *psi)
 
void set_psi_stage_service (void *psi)
 
void set_psi_statement_service (void *psi)
 
void set_psi_system_service (void *psi)
 
void set_psi_table_service (void *psi)
 
void set_psi_thread_service (void *psi)
 
void set_psi_transaction_service (void *psi)
 

Variables

PSI_memory_key key_memory_max_alloca
 
char * home_dir
 
const char * my_progname
 
void(* error_handler_hook )(uint my_err, const char *str, myf MyFlags)
 
void(* fatal_error_handler_hook )(uint my_err, const char *str, myf MyFlags)
 
void(* local_message_hook )(enum loglevel ll, uint ecode, va_list args)
 
uint my_file_limit
 
MYSQL_PLUGIN_IMPORT ulong my_thread_stack_size
 
void(* enter_cond_hook )(void *opaque_thd, mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)
 
void(* exit_cond_hook )(void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line)
 
void(* enter_stage_hook )(void *opaque_thd, const PSI_stage_info *new_stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)
 
void(* set_waiting_for_disk_space_hook )(void *opaque_thd, bool waiting)
 
int(* is_killed_hook )(const void *opaque_thd)
 
MYSQL_PLUGIN_IMPORT CHARSET_INFOdefault_charset_info
 
MYSQL_PLUGIN_IMPORT CHARSET_INFOall_charsets [MY_ALL_CHARSETS_SIZE]
 
CHARSET_INFO compiled_charsets []
 
ulong my_file_opened
 
ulong my_stream_opened
 
ulong my_tmp_file_created
 
ulong my_file_total_opened
 
bool my_init_done
 
MYSQL_PLUGIN_IMPORT int my_umask
 
int my_umask_dir
 
ulong my_default_record_cache_size
 
bool my_disable_locking
 
bool my_enable_symlinks
 
const char * charsets_dir
 
struct st_my_file_infomy_file_info
 
my_error_reporter my_charset_error_reporter
 
PSI_file_key key_file_io_cache
 
constexpr int my_b_EOF = INT_MIN
 
MYSQL_PLUGIN_IMPORT PSI_cond_bootstrappsi_cond_hook
 
MYSQL_PLUGIN_IMPORT PSI_data_lock_bootstrappsi_data_lock_hook
 
MYSQL_PLUGIN_IMPORT PSI_error_bootstrappsi_error_hook
 
MYSQL_PLUGIN_IMPORT PSI_file_bootstrappsi_file_hook
 
MYSQL_PLUGIN_IMPORT PSI_idle_bootstrappsi_idle_hook
 
MYSQL_PLUGIN_IMPORT PSI_mdl_bootstrappsi_mdl_hook
 
MYSQL_PLUGIN_IMPORT PSI_memory_bootstrappsi_memory_hook
 
MYSQL_PLUGIN_IMPORT PSI_mutex_bootstrappsi_mutex_hook
 
MYSQL_PLUGIN_IMPORT PSI_rwlock_bootstrappsi_rwlock_hook
 
MYSQL_PLUGIN_IMPORT PSI_socket_bootstrappsi_socket_hook
 
MYSQL_PLUGIN_IMPORT PSI_stage_bootstrappsi_stage_hook
 
MYSQL_PLUGIN_IMPORT PSI_statement_bootstrappsi_statement_hook
 
MYSQL_PLUGIN_IMPORT PSI_system_bootstrappsi_system_hook
 
MYSQL_PLUGIN_IMPORT PSI_table_bootstrappsi_table_hook
 
MYSQL_PLUGIN_IMPORT PSI_thread_bootstrappsi_thread_hook
 
MYSQL_PLUGIN_IMPORT PSI_transaction_bootstrappsi_transaction_hook
 
MYSQL_FILEmysql_stdin
 

Detailed Description

Macro Definition Documentation

◆ alloc_root_inited

#define alloc_root_inited (   A)    ((A)->inited())

◆ base_name

#define base_name (   A)    (A + dirname_length(A))

◆ DEBUG_SYNC_C

#define DEBUG_SYNC_C (   _sync_point_name_)

◆ DEBUG_SYNC_C_IF_THD

#define DEBUG_SYNC_C_IF_THD (   thd,
  _sync_point_name_ 
)

◆ DFLT_INIT_HITS

#define DFLT_INIT_HITS   3

◆ dynamic_element

#define dynamic_element (   array,
  array_index,
  type 
)    ((type)((array)->buffer) + (array_index))

◆ flush_io_cache

#define flush_io_cache (   info)    my_b_flush_io_cache((info), 1)

◆ is_filename_allowed

#define is_filename_allowed (   name,
  length,
  allow_cwd 
)    (true)

◆ MALLOC_OVERHEAD

#define MALLOC_OVERHEAD   8

◆ MAP_FAILED

#define MAP_FAILED   ((void *)-1)

◆ MAP_NORESERVE

#define MAP_NORESERVE   0

◆ MAP_NOSYNC

#define MAP_NOSYNC   0x0800

◆ MAP_PRIVATE

#define MAP_PRIVATE   0x0002

◆ MAP_SHARED

#define MAP_SHARED   0x0001

◆ MAX_SYSLOG_MESSAGE_SIZE

#define MAX_SYSLOG_MESSAGE_SIZE   1024

◆ ME_BELL

#define ME_BELL   4 /* DEPRECATED: Ring bell then printing message */

◆ ME_ERRORLOG

#define ME_ERRORLOG   64 /* Write the error message to error log */

◆ ME_FATALERROR

#define ME_FATALERROR   1024 /* Fatal statement error */

◆ MIN_COMPRESS_LENGTH

#define MIN_COMPRESS_LENGTH   50 /* Don't compress small bl. */

◆ MS_SYNC

#define MS_SYNC   0x0000

◆ my_access

#define my_access   access

◆ MY_ALL_CHARSETS_SIZE

#define MY_ALL_CHARSETS_SIZE   2048

◆ my_alloca

#define my_alloca (   SZ)    alloca((size_t)(SZ))

◆ MY_ALLOW_ZERO_PTR

#define MY_ALLOW_ZERO_PTR   64 /* my_realloc() ; zero ptr -> malloc */

◆ MY_APPEND_EXT

#define MY_APPEND_EXT   256 /* add 'ext' as additional extension*/

◆ MY_CHECK_ERROR

#define MY_CHECK_ERROR   1 /* Params to my_end; Check open-close */

◆ MY_COPYTIME

#define MY_COPYTIME   64 /* my_redel() copys time */

◆ my_delete_allow_opened

#define my_delete_allow_opened (   fname,
  flags 
)    my_delete((fname), (flags))

◆ MY_DELETE_OLD

#define MY_DELETE_OLD   256 /* my_create_with_symlink() */

◆ MY_DONT_CHECK_FILESIZE

#define MY_DONT_CHECK_FILESIZE   128 /* Option to init_io_cache() */

◆ MY_DONT_FREE_DBUG

#define MY_DONT_FREE_DBUG   4 /* Do not call DBUG_END() in my_end() */

◆ MY_DONT_OVERWRITE_FILE

#define MY_DONT_OVERWRITE_FILE   1024 /* my_copy: Don't overwrite file */

◆ MY_DONT_WAIT

#define MY_DONT_WAIT   64 /* my_lock() don't wait if can't lock */

◆ MY_ERRNO_EDOM

#define MY_ERRNO_EDOM   33

◆ MY_ERRNO_ERANGE

#define MY_ERRNO_ERANGE   34

◆ MY_FAE

#define MY_FAE   8 /* Fatal if any error */

◆ MY_FFNF

#define MY_FFNF   1 /* Fatal if file not found */

◆ MY_FILE_ERROR

#define MY_FILE_ERROR   ((size_t)-1)

◆ MY_FNABP

#define MY_FNABP   2 /* Fatal if not all bytes read/writen */

◆ MY_FREE_ON_ERROR

#define MY_FREE_ON_ERROR   128 /* my_realloc() ; Free old ptr on error */

◆ MY_FULL_IO

#define MY_FULL_IO   512 /* For my_read - loop intil I/O is complete */

◆ my_get_large_page_size

#define my_get_large_page_size (   void)    (0)

◆ MY_GIVE_INFO

#define MY_GIVE_INFO   2 /* Give time info about process*/

◆ MY_HOLD_ON_ERROR

#define MY_HOLD_ON_ERROR   256 /* my_realloc() ; Return old ptr on error */

◆ MY_HOLD_ORIGINAL_MODES

#define MY_HOLD_ORIGINAL_MODES   128 /* my_copy() holds to file modes */

◆ MY_IGNORE_BADFD

#define MY_IGNORE_BADFD   32 /* my_sync: ignore 'bad descriptor' errors */

◆ MY_INIT

#define MY_INIT (   name)
Value:
{ \
my_progname = name; \
my_init(); \
}
const string name("\ame\)

◆ MY_KEEP_PREALLOC

#define MY_KEEP_PREALLOC   1

◆ MY_LINK_WARNING

#define MY_LINK_WARNING   32 /* my_redel() gives warning if links */

◆ MY_MARK_BLOCKS_FREE

#define MY_MARK_BLOCKS_FREE   2 /* move used to free list and reuse them */

◆ MY_NABP

#define MY_NABP   4 /* Error if not all bytes read/writen */

◆ my_print_open_files

#define my_print_open_files ( )

◆ MY_RELATIVE_PATH

#define MY_RELATIVE_PATH   128 /* name is relative to 'dir' */

◆ MY_REPLACE_DIR

#define MY_REPLACE_DIR   1 /* replace dir in name with 'dir' */

◆ MY_REPLACE_EXT

#define MY_REPLACE_EXT   2 /* replace extension with 'ext' */

◆ MY_REPORT_WAITING_IF_FULL

#define MY_REPORT_WAITING_IF_FULL   64 /* my_write: set status as waiting */

◆ MY_RESOLVE_LINK

#define MY_RESOLVE_LINK   128 /* my_realpath(); Only resolve links */

◆ MY_RESOLVE_SYMLINKS

#define MY_RESOLVE_SYMLINKS   16 /* Resolve all symbolic links */

◆ MY_RETURN_REAL_PATH

#define MY_RETURN_REAL_PATH   32 /* return full path for file */

◆ my_safe_afree

#define my_safe_afree (   ptr,
  size,
  max_alloca_sz 
)    if (size > max_alloca_sz) my_free(ptr)

◆ my_safe_alloca

#define my_safe_alloca (   size,
  max_alloca_sz 
)
Value:
((size <= max_alloca_sz) ? my_alloca(size) \
PSI_memory_key key_memory_max_alloca
Definition: my_static.cc:66
#define my_alloca(SZ)
Definition: my_sys.h:215
#define MYF(v)
Definition: my_inttypes.h:124
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Below functions are used by the components.
Definition: my_memory.cc:57

◆ MY_SAFE_PATH

#define MY_SAFE_PATH   64 /* Return NULL if too long path */

◆ MY_SEEK_CUR

#define MY_SEEK_CUR   1

◆ MY_SEEK_END

#define MY_SEEK_END   2

◆ MY_SEEK_NOT_DONE

#define MY_SEEK_NOT_DONE   32 /* my_lock may have to do a seek */

◆ MY_SEEK_SET

#define MY_SEEK_SET   0

◆ MY_SYNC

#define MY_SYNC   4096 /* my_copy(): sync dst file */

◆ MY_SYNC_DIR

#define MY_SYNC_DIR   8192 /* my_create/delete/rename: sync directory */

◆ MY_THREADSAFE

#define MY_THREADSAFE   2048 /* my_seek(): lock fd mutex */

◆ MY_UNPACK_FILENAME

#define MY_UNPACK_FILENAME   4 /* Unpack name (~ -> home) */

◆ MY_WAIT_FOR_USER_TO_FIX_PANIC

#define MY_WAIT_FOR_USER_TO_FIX_PANIC   60 /* in seconds */

◆ MY_WAIT_GIVE_USER_A_MESSAGE

#define MY_WAIT_GIVE_USER_A_MESSAGE   10 /* Every 10 times of prev */

◆ MY_WAIT_IF_FULL

#define MY_WAIT_IF_FULL   32 /* Wait and try again if disk full error */

◆ MY_WME

#define MY_WME   16 /* Write message on error */

◆ MY_ZEROFILL

#define MY_ZEROFILL   32 /* my_malloc(), fill array with zero */

◆ MYF_RW

#define MYF_RW   MYF(MY_WME + MY_NABP) /* For my_read & my_write */

◆ MYSYS_ERRMSG_SIZE

#define MYSYS_ERRMSG_SIZE   (512)

Max length of an error message generated by mysys utilities.

Some mysys functions produce error messages. These mostly go to stderr. This constant defines the size of the buffer used to format the message. It should be kept in sync with MYSQL_ERRMSG_SIZE, since sometimes mysys errors are stored in the server diagnostics area, and we would like to avoid unexpected truncation.

◆ MYSYS_STRERROR_SIZE

#define MYSYS_STRERROR_SIZE   (128)

◆ PROT_READ

#define PROT_READ   1

◆ PROT_WRITE

#define PROT_WRITE   2

◆ RECORD_CACHE_SIZE

#define RECORD_CACHE_SIZE   (uint)(64 * 1024 - MALLOC_OVERHEAD)

Typedef Documentation

◆ ha_checksum

◆ IO_CACHE_CALLBACK

typedef int(* IO_CACHE_CALLBACK) (IO_CACHE *)

◆ my_error_reporter

typedef void(* my_error_reporter) (enum loglevel level, uint ecode,...)

◆ qsort2_cmp

typedef int(* qsort2_cmp) (const void *, const void *, const void *)

Enumeration Type Documentation

◆ cache_type

enum cache_type
Enumerator
TYPE_NOT_SET 
READ_CACHE 
WRITE_CACHE 
SEQ_READ_APPEND 
READ_FIFO 
READ_NET 
WRITE_NET 

◆ file_type

enum file_type
Enumerator
UNOPEN 
FILE_BY_OPEN 
FILE_BY_CREATE 
STREAM_BY_FOPEN 
STREAM_BY_FDOPEN 
FILE_BY_MKSTEMP 
FILE_BY_O_TMPFILE 

◆ flush_type

enum flush_type
Enumerator
FLUSH_KEEP 
FLUSH_RELEASE 
FLUSH_IGNORE_CHANGED 
FLUSH_FORCE_WRITE 

◆ my_syslog_options

Enumerator
MY_SYSLOG_PIDS 

◆ UnlinkOrKeepFile

Enumerator
UNLINK_FILE 
KEEP_FILE 

Function Documentation

◆ _my_b_get()

int _my_b_get ( IO_CACHE info)

◆ _my_b_net_read()

int _my_b_net_read ( IO_CACHE info,
uchar Buffer,
size_t  Count 
)

Read buffered from the net.

Return values
1if can't read requested characters
0if record read

◆ _my_b_read()

int _my_b_read ( IO_CACHE info,
uchar Buffer,
size_t  Count 
)

◆ _my_b_read_r()

int _my_b_read_r ( IO_CACHE info,
uchar Buffer,
size_t  Count 
)

◆ _my_b_seq_read()

int _my_b_seq_read ( IO_CACHE info,
uchar Buffer,
size_t  Count 
)

◆ _my_b_write()

int _my_b_write ( IO_CACHE info,
const uchar Buffer,
size_t  Count 
)

◆ add_compiled_collation()

void add_compiled_collation ( CHARSET_INFO cs)

◆ alloc_dynamic()

void* alloc_dynamic ( DYNAMIC_ARRAY array)

◆ array_append_string_unique()

bool array_append_string_unique ( const char *  str,
const char **  array,
size_t  size 
)

Append str to array, or move to the end if it already exists.

Parameters
strString to be appended
arrayThe array, terminated by a NULL element, all unused elements pre-initialized to NULL
sizeSize of the array; array must be terminated by a NULL pointer, so can hold size - 1 elements
Return values
falseSuccess
trueFailure, array is full

◆ charset_uninit()

void charset_uninit ( )

◆ check_if_legal_filename()

int check_if_legal_filename ( const char *  path)

◆ check_if_legal_tablename()

int check_if_legal_tablename ( const char *  path)

◆ claim_dynamic()

void claim_dynamic ( DYNAMIC_ARRAY array)

◆ cleanup_dirname()

size_t cleanup_dirname ( char *  to,
const char *  from 
)


Remove unwanted chars from dirname.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

IMPLEMENTATION: "/../" removes prev dir "/~/" removes all before ~ " is same as "/", except on Win32 at start of a file "/./" is removed Unpacks home_dir if "~/.." used Unpacks current dir if if "./.." used

Parameters
toStore result here
fromDirname to fix. May be same as to
Returns
length of new name

◆ close_cached_file()

void close_cached_file ( IO_CACHE cache)

◆ convert_dirname()

char* convert_dirname ( char *  to,
const char *  from,
const char *  from_end 
)

Convert directory name to use under this system.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

IMPLEMENTATION: If Windows converts '/' to '\' Adds a FN_LIBCHAR to end if the result string if there isn't one and the last isn't dev_char. Copies data from 'from' until ASCII(0) for until from == from_end If you want to use the whole 'from' string, just send NullS as the last argument.

If the result string is larger than FN_REFLEN -1, then it's cut.

Parameters
todestination buffer. Store result here. Must be at least of size min(FN_REFLEN, strlen(from) + 1) to make room for adding FN_LIBCHAR at the end.
fromOriginal filename. May be == to
from_endPointer at end of filename (normally end \0)
Returns
Returns pointer to end \0 in to

◆ create_temp_file()

File create_temp_file ( char *  to,
const char *  dir,
const char *  pfx,
int  mode,
UnlinkOrKeepFile  unlink_or_keep,
myf  MyFlags 
)

◆ delete_dynamic()

void delete_dynamic ( DYNAMIC_ARRAY array)

◆ dirname_length()

size_t dirname_length ( const char *  name)

Get the string length of the directory part of name, including the last FN_LIBCHAR.

If name is not a path, return 0.

Pre-condition: 'name' is a '\0'-terminated byte buffer.

Parameters
namepath to calculate directory length for.
Returns
length of directory part

◆ dirname_part()

size_t dirname_part ( char *  to,
const char *  name,
size_t *  to_res_length 
)

Gives directory part of filename.

Directory ends with '/'.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects. If the result is truncated, the return value will be larger than the length stored in 'to_length'.

Parameters
todestination buffer.
namepath to get the directory part of.
to_res_lengthstore the the number of bytes written into 'to'.
Returns
Actual length of directory part in 'name' (the number of bytes which would have been written if 'to' had been large enough).

◆ dynstr_append()

bool dynstr_append ( DYNAMIC_STRING str,
const char *  append 
)

◆ dynstr_append_mem()

bool dynstr_append_mem ( DYNAMIC_STRING str,
const char *  append,
size_t  length 
)

◆ dynstr_append_os_quoted()

bool dynstr_append_os_quoted ( DYNAMIC_STRING str,
const char *  append,
  ... 
)

◆ dynstr_free()

void dynstr_free ( DYNAMIC_STRING str)

◆ dynstr_realloc()

bool dynstr_realloc ( DYNAMIC_STRING str,
size_t  additional_size 
)

◆ dynstr_set()

bool dynstr_set ( DYNAMIC_STRING str,
const char *  init_str 
)

◆ dynstr_trunc()

bool dynstr_trunc ( DYNAMIC_STRING str,
size_t  n 
)

◆ end_io_cache()

int end_io_cache ( IO_CACHE info)

◆ escape_quotes_for_mysql()

size_t escape_quotes_for_mysql ( CHARSET_INFO charset_info,
char *  to,
size_t  to_length,
const char *  from,
size_t  length,
char  quote 
)

◆ escape_string_for_mysql()

size_t escape_string_for_mysql ( const CHARSET_INFO charset_info,
char *  to,
size_t  to_length,
const char *  from,
size_t  length 
)

◆ fn_ext() [1/2]

char* fn_ext ( char *  name)

◆ fn_ext() [2/2]

const char* fn_ext ( const char *  name)

◆ fn_format()

char* fn_format ( char *  to,
const char *  name,
const char *  dir,
const char *  extension,
uint  flag 
)

Formats a filename with possible replace of directory of extension Function can handle the case where 'to' == 'name' For a description of the flag values, consult my_sys.h The arguments should be in unix format.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'name', 'dir' and 'extension' are '\0'-terminated byte buffers (or nullptr where permitted).

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
todestination buffer.
namefile name component.
dirdirectory component.
extensionfilename extension
flag
Returns
to (destination buffer), or nullptr if overflow and MY_SAFE_PATH is used.

◆ fn_same()

char* fn_same ( char *  toname,
const char *  name,
int  flag 
)

◆ free_tmpdir()

void free_tmpdir ( MY_TMPDIR tmpdir)

◆ freeze_size()

void freeze_size ( DYNAMIC_ARRAY array)

◆ get_charset()

CHARSET_INFO* get_charset ( uint  cs_number,
myf  flags 
)

◆ get_charset_by_csname()

CHARSET_INFO* get_charset_by_csname ( const char *  cs_name,
uint  cs_flags,
myf  my_flags 
)

◆ get_charset_by_name()

CHARSET_INFO* get_charset_by_name ( const char *  cs_name,
myf  flags 
)

◆ get_charset_name()

const char* get_charset_name ( uint  cs_number)

◆ get_charset_number()

uint get_charset_number ( const char *  cs_name,
uint  cs_flags 
)

◆ get_charsets_dir()

char* get_charsets_dir ( char *  buf)

◆ get_collation_number()

uint get_collation_number ( const char *  name)

◆ get_file_perm()

MY_MODE get_file_perm ( ulong  perm_flags)

◆ get_global_errmsg()

const char* get_global_errmsg ( int  nr)

◆ has_path()

bool has_path ( const char *  name)

◆ init_compiled_charsets()

bool init_compiled_charsets ( myf  flags)

◆ init_dynamic_string()

bool init_dynamic_string ( DYNAMIC_STRING str,
const char *  init_str,
size_t  init_alloc,
size_t  alloc_increment 
)

◆ init_io_cache()

int init_io_cache ( IO_CACHE info,
File  file,
size_t  cachesize,
enum cache_type  type,
my_off_t  seek_offset,
bool  use_async_io,
myf  cache_myflags 
)

◆ init_io_cache_ext()

int init_io_cache_ext ( IO_CACHE info,
File  file,
size_t  cachesize,
enum cache_type  type,
my_off_t  seek_offset,
bool  use_async_io,
myf  cache_myflags,
PSI_file_key  file_key 
)

◆ init_io_cache_share()

void init_io_cache_share ( IO_CACHE read_cache,
IO_CACHE_SHARE cshare,
IO_CACHE write_cache,
uint  num_threads 
)

◆ init_tmpdir()

bool init_tmpdir ( MY_TMPDIR tmpdir,
const char *  pathlist 
)

◆ insert_dynamic()

bool insert_dynamic ( DYNAMIC_ARRAY array,
const void *  element 
)

◆ intern_filename()

char* intern_filename ( char *  to,
const char *  from 
)

Fix a filename to intern (UNIX format).

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
todestination buffer.
fromsource string.
Returns
to (destination buffer).

◆ memdup_root()

void* memdup_root ( MEM_ROOT root,
const void *  str,
size_t  len 
)

◆ multi_alloc_root()

void* multi_alloc_root ( MEM_ROOT mem_root,
  ... 
)

◆ my_b_append()

int my_b_append ( IO_CACHE info,
const uchar Buffer,
size_t  Count 
)

◆ my_b_bytes_in_cache()

size_t my_b_bytes_in_cache ( const IO_CACHE info)
inline

◆ my_b_clear()

void my_b_clear ( IO_CACHE info)
inline

◆ my_b_copy_to_file()

int my_b_copy_to_file ( IO_CACHE cache,
FILE *  file 
)

◆ my_b_filelength()

my_off_t my_b_filelength ( IO_CACHE info)

◆ my_b_fill()

size_t my_b_fill ( IO_CACHE info)

◆ my_b_flush_io_cache()

int my_b_flush_io_cache ( IO_CACHE info,
int  need_append_buffer_lock 
)

◆ my_b_get()

int my_b_get ( IO_CACHE info)
inline

◆ my_b_get_buffer_start()

uchar* my_b_get_buffer_start ( const IO_CACHE info)
inline

◆ my_b_get_bytes_in_buffer()

size_t my_b_get_bytes_in_buffer ( const IO_CACHE info)
inline

◆ my_b_get_pos_in_file()

my_off_t my_b_get_pos_in_file ( const IO_CACHE info)
inline

◆ my_b_gets()

size_t my_b_gets ( IO_CACHE info,
char *  to,
size_t  max_length 
)

◆ my_b_inited()

bool my_b_inited ( const IO_CACHE info)
inline

◆ my_b_printf()

size_t my_b_printf ( IO_CACHE info,
const char *  fmt,
  ... 
)

Simple printf version.

Used for logging in MySQL. Supports 'c', 's', 'b', 'd', 'u', 'ld', 'lu' and 'llu'. Returns number of written characters, or (size_t) -1 on error.

Parameters
infoThe IO_CACHE to write to
fmtformat string
...variable list of arguments
Returns
number of bytes written, -1 if an error occurred

◆ my_b_read()

int my_b_read ( IO_CACHE info,
uchar buffer,
size_t  count 
)
inline

◆ my_b_safe_write()

int my_b_safe_write ( IO_CACHE info,
const uchar Buffer,
size_t  Count 
)

◆ my_b_seek()

void my_b_seek ( IO_CACHE info,
my_off_t  pos 
)

◆ my_b_tell()

my_off_t my_b_tell ( const IO_CACHE info)
inline

◆ my_b_vprintf()

size_t my_b_vprintf ( IO_CACHE info,
const char *  fmt,
va_list  args 
)

Implementation of my_b_printf.

Parameters
infoThe IO_CACHE to write to
fmtformat string
argsvariable list of arguments
Returns
number of bytes written, -1 if an error occurred

◆ my_b_write()

int my_b_write ( IO_CACHE info,
const uchar buffer,
size_t  count 
)
inline

◆ my_block_write()

int my_block_write ( IO_CACHE info,
const uchar Buffer,
size_t  Count,
my_off_t  pos 
)

◆ my_charset_get_by_name()

CHARSET_INFO* my_charset_get_by_name ( MY_CHARSET_LOADER loader,
const char *  cs_name,
uint  cs_flags,
myf  flags 
)

Find character set by name: extended version of get_charset_by_csname() to return error messages to the caller.

Parameters
loaderCharacter set loader
cs_nameCollation name
cs_flagsCharacter set flags (e.g. default or binary collation)
flagsFlags
Returns
NULL on error, pointer to collation on success

◆ my_charset_loader_init_mysys()

void my_charset_loader_init_mysys ( MY_CHARSET_LOADER loader)

Initialize character set loader to use mysys memory management functions.

Parameters
loaderLoader to initialize

◆ my_charset_same()

bool my_charset_same ( const CHARSET_INFO cs1,
const CHARSET_INFO cs2 
)

◆ my_checksum()

ha_checksum my_checksum ( ha_checksum  crc,
const uchar mem,
size_t  count 
)

◆ my_chmod()

bool my_chmod ( const char *  filename,
ulong  perm_flags,
myf  my_flags 
)

◆ my_chsize()

int my_chsize ( File  fd,
my_off_t  newlength,
int  filler,
myf  MyFlags 
)

◆ my_close()

int my_close ( File  Filedes,
myf  MyFlags 
)

◆ my_closelog()

int my_closelog ( void  )

Closes/de-registers the system logging handle.

Note: Its a thread-unsafe function. It should either be invoked from the main thread or some extra thread safety measures need to be taken.

Returns
0 Success -1 Error

◆ my_collation_get_by_name()

CHARSET_INFO* my_collation_get_by_name ( MY_CHARSET_LOADER loader,
const char *  name,
myf  flags 
)

Find collation by name: extended version of get_charset_by_name() to return error messages to the caller.

Parameters
loaderCharacter set loader
nameCollation name
flagsFlags
Returns
NULL on error, pointer to collation on success

◆ my_compress()

bool my_compress ( uchar ,
size_t *  ,
size_t *   
)

◆ my_compress_alloc()

uchar* my_compress_alloc ( const uchar packet,
size_t *  len,
size_t *  complen 
)

◆ my_copy()

int my_copy ( const char *  from,
const char *  to,
myf  MyFlags 
)

◆ my_create()

File my_create ( const char *  FileName,
int  CreateFlags,
int  AccessFlags,
myf  MyFlags 
)

◆ my_create_with_symlink()

File my_create_with_symlink ( const char *  linkname,
const char *  filename,
int  createflags,
int  access_flags,
myf  MyFlags 
)

◆ my_delete()

int my_delete ( const char *  name,
myf  MyFlags 
)

◆ my_delete_with_symlink()

int my_delete_with_symlink ( const char *  name,
myf  MyFlags 
)

◆ my_end()

void my_end ( int  infoflag)

◆ my_error()

void my_error ( int  nr,
myf  MyFlags,
  ... 
)

Fill in and print a previously registered error message.

Note
Goes through the (sole) function registered in error_handler_hook
Parameters
nrerror number
MyFlagsFlags
...variable list matching that error format string

◆ my_error_register()

int my_error_register ( const char *(*)(int)  get_errmsg,
int  first,
int  last 
)

Register error messages for use with my_error().

The function is expected to return addresses to NUL-terminated C character strings. NULL pointers and empty strings ("") are allowed. These will be mapped to "Unknown error" when my_error() is called with a matching error number. This function registers the error numbers 'first' to 'last'. No overlapping with previously registered error numbers is allowed.

Parameters
get_errmsgfunction that returns error messages
firsterror number of first message in the array
lasterror number of last message in the array
Return values
0OK
!=0 Error

◆ my_error_unregister()

bool my_error_unregister ( int  first,
int  last 
)

Unregister formerly registered error messages.

This function unregisters the error numbers 'first' to 'last'. These must have been previously registered by my_error_register(). 'first' and 'last' must exactly match the registration. If a matching registration is present, the header is removed from the list.

Parameters
firsterror number of first message
lasterror number of last message
Return values
trueError, no such number range registered.
falseOK

◆ my_fallocator()

int my_fallocator ( File  fd,
my_off_t  newlength,
int  filler,
myf  MyFlags 
)

Change size of the specified file.

Forces the OS to reserve disk space for the file, even when called to fill with zeros. he function also changes the file position. Usually it points to the end of the file after execution.

Note
Implementation based on, and mostly copied from, my_chsize. But instead of ftruncate uses posix_fallocate. This implementation was needed because of allocation in temptable. Probably this implementation should replace my_chsize implementation.
Parameters
[in]fdFile descriptor
[in]newlengthNew file size
[in]fillerFill up all bytes after new_length with this character
[in]MyFlagsFlags
Returns
0 if OK, 1 otherwise

◆ my_fclose()

int my_fclose ( FILE *  fd,
myf  MyFlags 
)

◆ my_fdopen()

FILE* my_fdopen ( File  Filedes,
const char *  name,
int  Flags,
myf  MyFlags 
)

◆ my_filename()

const char* my_filename ( File  fd)

◆ my_fileno()

File my_fileno ( FILE *  fd)

◆ my_fopen()

FILE* my_fopen ( const char *  FileName,
int  Flags,
myf  MyFlags 
)

◆ my_fread()

size_t my_fread ( FILE *  stream,
uchar Buffer,
size_t  Count,
myf  MyFlags 
)

◆ my_free_open_file_info()

void my_free_open_file_info ( void  )

◆ my_freopen()

FILE* my_freopen ( const char *  path,
const char *  mode,
FILE *  stream 
)

Change the file associated with a file stream.

Parameters
pathPath to file.
modeMode of the stream.
streamFile stream.
Note
This function is used to redirect stdout and stderr to a file and subsequently to close and reopen that file for log rotation.
Return values
AFILE pointer on success. Otherwise, NULL.

◆ my_fseek()

my_off_t my_fseek ( FILE *  stream,
my_off_t  pos,
int  whence 
)

◆ my_ftell()

my_off_t my_ftell ( FILE *  stream)

◆ my_fwrite()

size_t my_fwrite ( FILE *  stream,
const uchar Buffer,
size_t  Count,
myf  MyFlags 
)

◆ my_get_err_msg()

const char* my_get_err_msg ( int  nr)

Get an error format string from one of the my_error_register()ed sets.

Note
NULL values are possible even within a registered range.
Parameters
nrErrno
Return values
NULLif no message is registered for this error number
strC-string

◆ my_get_ptr()

my_off_t my_get_ptr ( uchar ptr,
size_t  pack_length 
)

◆ my_gethwaddr()

bool my_gethwaddr ( uchar to)

◆ my_getpagesize()

static int my_getpagesize ( )
inlinestatic

◆ my_getwd()

int my_getwd ( char *  buf,
size_t  size,
myf  MyFlags 
)

◆ my_init()

bool my_init ( void  )

Initialize my_sys functions, resources and variables.

Returns
Initialization result
Return values
falseSuccess
trueError. Couldn't initialize environment

◆ my_init_dynamic_array()

bool my_init_dynamic_array ( DYNAMIC_ARRAY array,
PSI_memory_key  key,
uint  element_size,
void *  init_buffer,
uint  init_alloc,
uint  alloc_increment 
)

◆ my_init_mysys_psi_keys()

void my_init_mysys_psi_keys ( void  )

◆ my_is_same_file()

int my_is_same_file ( File  file,
const ST_FILE_ID file_id 
)

Return non-zero if the file descriptor and a previously lstat-ed file identified by file_id point to the same file.

◆ my_is_symlink()

int my_is_symlink ( const char *  filename,
ST_FILE_ID file_id 
)

◆ my_load_path()

char* my_load_path ( char *  to,
const char *  path,
const char *  own_path_prefix 
)

Returns full load-path for a file.

to may be = path.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'path' and 'own_path_prefix' are '\0'-terminated byte buffers.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
toPointer to destination which will hold the expanded path.
pathPointer to buffer containing the supplied path.
own_path_prefixPrefix to be appended to path.
Return values
toPointer to the supplied destination buffer that will hold the full load-path.

◆ my_message()

void my_message ( uint  error,
const char *  str,
myf  MyFlags 
)

Print an error message.

Note
Goes through the (sole) function registered in error_handler_hook
Parameters
errorerror number
strerror message
MyFlagsFlags

◆ my_message_local()

void my_message_local ( enum loglevel  ll,
uint  ecode,
  ... 
)

Issue a message locally (i.e.

on the same host the program is running on, don't transmit to a client).

This goes through local_message_hook, i.e. by default, it calls my_message_local_stderr() which prepends an Error/Warning/Note label to the string, then prints it to stderr using my_message_stderr(). More advanced programs can use their own printers; mysqld for instance uses its own error log facilities which prepend an ISO 8601 / RFC 3339 compliant timestamp etc.

Parameters
lllog level: (ERROR|WARNING|INFORMATION)_LEVEL the printer may use these to filter for verbosity
ecodeError code of a error message.
...parameters to go with the error message.

◆ my_message_local_stderr()

void my_message_local_stderr ( enum loglevel  ll,
uint  ecode,
va_list  args 
)

Issue a message locally (i.e.

on the same host the program is running on, don't transmit to a client).

This is the default value for local_message_hook, and therefore the default printer for my_message_local(). mysys users should not call this directly, but go through my_message_local() instead.

This printer prepends an Error/Warning/Note label to the string, then prints it to stderr using my_message_stderr(). Since my_message_stderr() appends a '
', the format string should not end in a newline.

Parameters
lllog level: (ERROR|WARNING|INFORMATION)_LEVEL the printer may use these to filter for verbosity
ecodeError code of a error message.
argsparameters to go with the error message.

◆ my_message_stderr()

void my_message_stderr ( uint  error,
const char *  str,
myf  MyFlags 
)

Print an error message on stderr.

Prefixed with the binary's name (sans .exe, where applicable, and without path, both to keep our test cases sane). The name is intended to aid debugging by clarifying which binary reported an error, especially in cases like mysql_upgrade which calls several other tools whose messages should be distinguishable from each other's, and from mysql_upgrade's.

This is low-level; in most cases, you should use my_message_local() instead (which by default goes through my_message_local_stderr(), which is a wrapper around this function that adds a severity level).

Parameters
errorThe error number. Currently unused.
strThe message to print. Not trailing
needed.
MyFlagsME_BELL to beep, or 0.

◆ my_mkdir()

int my_mkdir ( const char *  dir,
int  Flags,
myf  MyFlags 
)

◆ my_mmap()

void* my_mmap ( void *  ,
size_t  ,
int  ,
int  ,
int  ,
my_off_t   
)

◆ my_msync()

int my_msync ( int  ,
void *  ,
size_t  ,
int   
)

◆ my_multi_malloc()

void* my_multi_malloc ( PSI_memory_key  key,
myf  flags,
  ... 
)

◆ my_munmap()

int my_munmap ( void *  ,
size_t   
)

◆ my_once_alloc()

void* my_once_alloc ( size_t  Size,
myf  MyFlags 
)

◆ my_once_free()

void my_once_free ( void  )

◆ my_once_memdup()

void* my_once_memdup ( const void *  src,
size_t  len,
myf  myflags 
)

◆ my_once_strdup()

char* my_once_strdup ( const char *  src,
myf  myflags 
)

◆ my_open()

File my_open ( const char *  FileName,
int  Flags,
myf  MyFlags 
)

◆ my_openlog()

int my_openlog ( const char *  name,
int  option,
int  facility 
)

Opens/Registers a new handle for system logging.

Note: It's a thread-unsafe function. It should either be invoked from the main thread or some extra thread safety measures need to be taken.

Parameters
nameName of the event source / syslog ident.
optionMY_SYSLOG_PIDS to log PID with each message.
facilityType of program. Passed to openlog().
Returns
0 Success -1 Error, log not opened -2 Error, not updated, using previous values

◆ my_path()

char* my_path ( char *  to,
const char *  progname,
const char *  own_pathname_part 
)

◆ my_pread()

size_t my_pread ( File  Filedes,
uchar Buffer,
size_t  Count,
my_off_t  offset,
myf  MyFlags 
)

◆ my_printf_error()

void my_printf_error ( uint  error,
const char *  format,
myf  MyFlags,
  ... 
)

Print an error message.

Note
Goes through the (sole) function registered in error_handler_hook
Parameters
errorerror number
formatformat string
MyFlagsFlags
...variable list matching that error format string

◆ my_printv_error()

void my_printv_error ( uint  error,
const char *  format,
myf  MyFlags,
va_list  ap 
)

Print an error message.

Note
Goes through the (sole) function registered in error_handler_hook
Parameters
errorerror number
formatformat string
MyFlagsFlags
apvariable list matching that error format string

◆ my_pwrite()

size_t my_pwrite ( File  Filedes,
const uchar Buffer,
size_t  Count,
my_off_t  offset,
myf  MyFlags 
)

Write a chunk of bytes to a file at a given position.

SYNOPSIOS my_pwrite() Filedes File decsriptor Buffer Buffer to write data from Count Number of bytes to write offset Position to write to MyFlags Flags

NOTES This differs from the normal pwrite() call in that we don't care to set the position in the file back to the original position if the system doesn't support pwrite()

if (MyFlags & (MY_NABP | MY_FNABP)) returns 0 if Count == 0 On succes, 0 On failure, (size_t)-1 == MY_FILE_ERROR

otherwise returns 0 if Count == 0 On success, the number of bytes written. On partial success (if less than Count bytes could be written), the actual number of bytes written. On failure, (size_t)-1 == MY_FILE_ERROR

◆ my_read()

size_t my_read ( File  Filedes,
uchar Buffer,
size_t  Count,
myf  MyFlags 
)

Read a chunk of bytes from a file with retry's if needed If flag MY_FULL_IO is set then keep reading until EOF is found.

Parameters
Filedesthe context to reset
[out]BufferBuffer to hold at least Count bytes
CountBytes to read
MyFlagsFlags on what to do on error
Returns
Operation status
Return values
-1on error
0if flag has bits MY_NABP or MY_FNABP set
Nnumber of bytes read

◆ my_readlink()

int my_readlink ( char *  to,
const char *  filename,
myf  MyFlags 
)

◆ my_realpath()

int my_realpath ( char *  to,
const char *  filename,
myf  MyFlags 
)

◆ my_register_filename()

File my_register_filename ( File  fd,
const char *  FileName,
enum file_type  type_of_file,
uint  error_message_number,
myf  MyFlags 
)

◆ my_rename()

int my_rename ( const char *  from,
const char *  to,
myf  MyFlags 
)

◆ my_rename_with_symlink()

int my_rename_with_symlink ( const char *  from,
const char *  to,
myf  MyFlags 
)

◆ my_seek()

my_off_t my_seek ( File  fd,
my_off_t  pos,
int  whence,
myf  MyFlags 
)

◆ my_set_max_open_files()

uint my_set_max_open_files ( uint  files)

◆ my_setwd()

int my_setwd ( const char *  dir,
myf  MyFlags 
)

◆ my_store_ptr()

void my_store_ptr ( uchar buff,
size_t  pack_length,
my_off_t  pos 
)

◆ my_strerror()

char* my_strerror ( char *  buf,
size_t  len,
int  nr 
)

Get a string describing a system or handler error.

thread-safe.

Parameters
bufa buffer in which to return the error message
lenthe size of the aforementioned buffer
nrthe error number
Return values
bufalways buf. for signature compatibility with strerror(3).

◆ my_symlink()

int my_symlink ( const char *  content,
const char *  linkname,
myf  MyFlags 
)

◆ my_sync()

int my_sync ( File  fd,
myf  my_flags 
)

◆ my_sync_dir()

int my_sync_dir ( const char *  dir_name,
myf  my_flags 
)

◆ my_sync_dir_by_file()

int my_sync_dir_by_file ( const char *  file_name,
myf  my_flags 
)

◆ my_syslog()

int my_syslog ( const CHARSET_INFO cs,
enum loglevel  level,
const char *  msg 
)

Sends message to the system logger.

On Windows, the specified message is internally converted to UCS-2 encoding, while on other platforms, no conversion takes place and the string is passed to the syslog API as it is.

Parameters
csCharacter set info of the message string
levelLog level
msgMessage to be logged
Returns
0 Success -1 Error

◆ my_tell()

my_off_t my_tell ( File  fd,
myf  MyFlags 
)

◆ my_tmpdir()

char* my_tmpdir ( MY_TMPDIR tmpdir)

◆ my_uncompress()

bool my_uncompress ( uchar ,
size_t  ,
size_t *   
)

◆ my_write()

size_t my_write ( File  Filedes,
const uchar Buffer,
size_t  Count,
myf  MyFlags 
)

Write a chunk of bytes to a file.

if (MyFlags & (MY_NABP | MY_FNABP)) returns 0 if Count == 0 On succes, 0 On failure, (size_t)-1 == MY_FILE_ERROR

otherwise returns 0 if Count == 0 On success, the number of bytes written. On partial success (if less than Count bytes could be written), the actual number of bytes written. On failure, (size_t)-1 == MY_FILE_ERROR

◆ normalize_dirname()

size_t normalize_dirname ( char *  to,
const char *  from 
)

Convert a directory name to a format which can be compared as strings.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
toresult buffer, FN_REFLEN chars in length; may be == from
from'packed' directory name, in whatever format
Returns
size of the normalized name
  • Ensures that last char is FN_LIBCHAR, unless it is FN_DEVCHAR
  • Uses cleanup_dirname
Note
It does not expand ~/ (although, see cleanup_dirname). Nor does it do any case folding. All case-insensitive normalization should be done by the caller.

◆ open_cached_file()

bool open_cached_file ( IO_CACHE cache,
const char *  dir,
const char *  prefix,
size_t  cache_size,
myf  cache_myflags 
)

◆ pop_dynamic()

void* pop_dynamic ( DYNAMIC_ARRAY )

◆ real_open_cached_file()

bool real_open_cached_file ( IO_CACHE cache)

◆ reinit_io_cache()

bool reinit_io_cache ( IO_CACHE info,
enum cache_type  type,
my_off_t  seek_offset,
bool  use_async_io,
bool  clear_cache 
)

◆ remove_io_thread()

void remove_io_thread ( IO_CACHE info)

◆ reset_dynamic()

static void reset_dynamic ( DYNAMIC_ARRAY array)
inlinestatic

◆ resolve_charset()

bool resolve_charset ( const char *  cs_name,
const CHARSET_INFO default_cs,
const CHARSET_INFO **  cs 
)

Resolve character set by the character set name (utf8, latin1, ...).

The function tries to resolve character set by the specified name. If there is character set with the given name, it is assigned to the "cs" parameter and false is returned. If there is no such character set, "default_cs" is assigned to the "cs" and true is returned.

Parameters
[in]cs_nameCharacter set name.
[in]default_csDefault character set.
[out]csVariable to store character set.
Returns
false if character set was resolved successfully; true if there is no character set with given name.

◆ resolve_collation()

bool resolve_collation ( const char *  cl_name,
const CHARSET_INFO default_cl,
const CHARSET_INFO **  cl 
)

Resolve collation by the collation name (utf8_general_ci, ...).

The function tries to resolve collation by the specified name. If there is collation with the given name, it is assigned to the "cl" parameter and false is returned. If there is no such collation, "default_cl" is assigned to the "cl" and true is returned.

Parameters
[out]clVariable to store collation.
[in]cl_nameCollation name.
[in]default_clDefault collation.
Returns
false if collation was resolved successfully; true if there is no collation with given name.

◆ safe_strdup_root()

char* safe_strdup_root ( MEM_ROOT root,
const char *  str 
)

◆ set_psi_cond_service()

void set_psi_cond_service ( void *  psi)

◆ set_psi_data_lock_service()

void set_psi_data_lock_service ( void *  psi)

◆ set_psi_error_service()

void set_psi_error_service ( void *  psi)

◆ set_psi_file_service()

void set_psi_file_service ( void *  psi)

◆ set_psi_idle_service()

void set_psi_idle_service ( void *  psi)

◆ set_psi_mdl_service()

void set_psi_mdl_service ( void *  psi)

◆ set_psi_memory_service()

void set_psi_memory_service ( void *  psi)

◆ set_psi_mutex_service()

void set_psi_mutex_service ( void *  psi)

◆ set_psi_rwlock_service()

void set_psi_rwlock_service ( void *  psi)

◆ set_psi_socket_service()

void set_psi_socket_service ( void *  psi)

◆ set_psi_stage_service()

void set_psi_stage_service ( void *  psi)

◆ set_psi_statement_service()

void set_psi_statement_service ( void *  psi)

◆ set_psi_system_service()

void set_psi_system_service ( void *  psi)

◆ set_psi_table_service()

void set_psi_table_service ( void *  psi)

◆ set_psi_thread_service()

void set_psi_thread_service ( void *  psi)

◆ set_psi_transaction_service()

void set_psi_transaction_service ( void *  psi)

◆ setup_io_cache()

void setup_io_cache ( IO_CACHE info)

◆ strdup_root()

char* strdup_root ( MEM_ROOT root,
const char *  str 
)

◆ strlength()

size_t strlength ( const char *  str)

Calculate the length of str not including any trailing ' '-bytes.

Pre-condition: 'str' is a '\0'-terminated byte buffer.

Parameters
strinput to calculate the length of.
Returns
length of string with end-space:s not counted.

◆ strmake_root()

char* strmake_root ( MEM_ROOT root,
const char *  str,
size_t  len 
)

◆ system_filename()

size_t system_filename ( char *  to,
const char *  from 
)

Convert filename (unix standard) to system standard Used before system command's like open(), create()

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
todestination buffer.
fromsource string.
Returns
used length of to

◆ test_if_hard_path()

int test_if_hard_path ( const char *  dir_name)

◆ thr_set_sync_wait_callback()

void thr_set_sync_wait_callback ( void(*)(void)  before_sync,
void(*)(void)  after_sync 
)

◆ to_unix_path()

void to_unix_path ( char *  to)

Convert filename to unix style filename.

Remarks
On Windows, converts '\' to '/'.
Parameters
toA pathname.

◆ unpack_dirname()

size_t unpack_dirname ( char *  to,
const char *  from 
)

Fixes a directory name so that can be used by open().

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Parameters
toResult buffer, FN_REFLEN characters. May be == from
from'Packed' directory name (may contain ~)
  • Uses normalize_dirname()
  • Expands ~/... to home_dir/...
  • Changes a UNIX filename to system filename (replaces / with \ on windows)
Returns
Length of new directory name (= length of to)

◆ unpack_filename()

size_t unpack_filename ( char *  to,
const char *  from 
)

Fix filename so it can be used by open, create.

Pre-condition: At least FN_REFLEN bytes can be stored in buffer pointed to by 'to'. 'from' is a '\0'-terminated byte buffer.

Post-condition: At most FN_REFLEN bytes will have been written to 'to'. If the combined length of 'from' and any expanded elements exceeds FN_REFLEN-1, the result is truncated and likely not what the caller expects.

Note
to may be == from
~ will only be expanded if total length < FN_REFLEN
Parameters
toStore result here. Must be at least of size FN_REFLEN.
fromFilename in unix format (with ~)
Returns
# length of to

◆ wait_for_free_space()

void wait_for_free_space ( const char *  filename,
int  errors 
)

Variable Documentation

◆ all_charsets

◆ charsets_dir

const char* charsets_dir

◆ compiled_charsets

CHARSET_INFO compiled_charsets[]

◆ default_charset_info

MYSQL_PLUGIN_IMPORT CHARSET_INFO* default_charset_info

◆ enter_cond_hook

void(* enter_cond_hook) (void *opaque_thd, mysql_cond_t *cond, mysql_mutex_t *mutex, const PSI_stage_info *stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)

◆ enter_stage_hook

void(* enter_stage_hook) (void *opaque_thd, const PSI_stage_info *new_stage, PSI_stage_info *old_stage, const char *src_function, const char *src_file, int src_line)

◆ error_handler_hook

void(* error_handler_hook) (uint my_err, const char *str, myf MyFlags)

◆ exit_cond_hook

void(* exit_cond_hook) (void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line)

◆ fatal_error_handler_hook

void(* fatal_error_handler_hook) (uint my_err, const char *str, myf MyFlags)

◆ home_dir

char* home_dir

◆ is_killed_hook

int(* is_killed_hook) (const void *opaque_thd)

◆ key_file_io_cache

PSI_file_key key_file_io_cache

◆ key_memory_max_alloca

PSI_memory_key key_memory_max_alloca

◆ local_message_hook

void(* local_message_hook) (enum loglevel ll, uint ecode, va_list args)

◆ my_b_EOF

constexpr int my_b_EOF = INT_MIN

◆ my_charset_error_reporter

my_error_reporter my_charset_error_reporter

◆ my_default_record_cache_size

ulong my_default_record_cache_size

◆ my_disable_locking

bool my_disable_locking

◆ my_enable_symlinks

bool my_enable_symlinks

◆ my_file_info

struct st_my_file_info* my_file_info

◆ my_file_limit

uint my_file_limit

◆ my_file_opened

ulong my_file_opened

◆ my_file_total_opened

ulong my_file_total_opened

◆ my_init_done

bool my_init_done

◆ my_progname

const char* my_progname

◆ my_stream_opened

ulong my_stream_opened

◆ my_thread_stack_size

MYSQL_PLUGIN_IMPORT ulong my_thread_stack_size

◆ my_tmp_file_created

ulong my_tmp_file_created

◆ my_umask

MYSQL_PLUGIN_IMPORT int my_umask

◆ my_umask_dir

int my_umask_dir

◆ mysql_stdin

MYSQL_FILE* mysql_stdin

◆ psi_cond_hook

◆ psi_data_lock_hook

◆ psi_error_hook

◆ psi_file_hook

◆ psi_idle_hook

◆ psi_mdl_hook

◆ psi_memory_hook

◆ psi_mutex_hook

◆ psi_rwlock_hook

◆ psi_socket_hook

◆ psi_stage_hook

◆ psi_statement_hook

◆ psi_system_hook

◆ psi_table_hook

◆ psi_thread_hook

◆ psi_transaction_hook

◆ set_waiting_for_disk_space_hook

void(* set_waiting_for_disk_space_hook) (void *opaque_thd, bool waiting)