48#ifdef HAVE_SYS_SELECT_H
49#include <sys/select.h>
100#define MY_INIT(name) \
102 my_progname = name; \
115#define MYSYS_ERRMSG_SIZE (512)
116#define MYSYS_STRERROR_SIZE (128)
118#define MY_FILE_ERROR ((size_t)-1)
126#define MY_WAIT_IF_FULL 32
127#define MY_IGNORE_BADFD 32
128#define MY_REPORT_WAITING_IF_FULL 64
129#define MY_FULL_IO 512
130#define MY_DONT_CHECK_FILESIZE 128
131#define MY_LINK_WARNING 32
132#define MY_COPYTIME 64
133#define MY_DELETE_OLD 256
134#define MY_RESOLVE_LINK 128
135#define MY_HOLD_ORIGINAL_MODES 128
136#define MY_SEEK_NOT_DONE 32
137#define MY_DONT_WAIT 64
138#define MY_ZEROFILL 32
139#define MY_ALLOW_ZERO_PTR 64
140#define MY_FREE_ON_ERROR 128
141#define MY_HOLD_ON_ERROR 256
142#define MY_DONT_OVERWRITE_FILE 1024
145#define MYF_RW MYF(MY_WME + MY_NABP)
147#define MY_CHECK_ERROR 1
148#define MY_GIVE_INFO 2
149#define MY_DONT_FREE_DBUG 4
153#define ME_ERRORLOG 64
154#define ME_FATALERROR 1024
157#define MY_REPLACE_DIR 1
158#define MY_REPLACE_EXT 2
159#define MY_UNPACK_FILENAME 4
161#define MY_RESOLVE_SYMLINKS 16
162#define MY_RETURN_REAL_PATH 32
163#define MY_SAFE_PATH 64
164#define MY_RELATIVE_PATH 128
165#define MY_APPEND_EXT 256
173#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60
174#define MY_WAIT_GIVE_USER_A_MESSAGE 10
175#define MIN_COMPRESS_LENGTH 50
176#define DFLT_INIT_HITS 3
179#define MY_ERRNO_EDOM 33
180#define MY_ERRNO_ERANGE 34
190#define my_safe_alloca(size, max_alloca_sz) \
191 ((size <= max_alloca_sz) ? my_alloca(size) \
192 : my_malloc(key_memory_max_alloca, size, MYF(0)))
193#define my_safe_afree(ptr, size, max_alloca_sz) \
194 if (size > max_alloca_sz) my_free(ptr)
196#if defined(ENABLED_DEBUG_SYNC)
197using DebugSyncCallbackFp = void (*)(
const char *, size_t);
198extern DebugSyncCallbackFp debug_sync_C_callback_ptr;
200#define DEBUG_SYNC_C(_sync_point_name_) \
202 if (debug_sync_C_callback_ptr != NULL) \
203 (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); \
205#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_) \
207 if (debug_sync_C_callback_ptr != NULL && thd) \
208 (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); \
211#define DEBUG_SYNC_C(_sync_point_name_)
212#define DEBUG_SYNC_C_IF_THD(thd, _sync_point_name_)
215#ifdef HAVE_LINUX_LARGE_PAGES
218#define my_get_large_page_size() (0)
221#define my_alloca(SZ) alloca((size_t)(SZ))
241 const char *src_function,
const char *src_file,
245 const char *src_function,
const char *src_file,
251 const char *src_function,
const char *src_file,
264#define MY_ALL_CHARSETS_SIZE 2048
470typedef int (*
qsort2_cmp)(
const void *,
const void *,
const void *);
493 return info->buffer !=
nullptr;
499 if (
info->read_pos + count <= info->read_end) {
508 if (
info->write_pos + count <= info->write_end) {
519 if (
info->read_pos !=
info->read_end) {
521 return info->read_pos[-1];
527 return info->pos_in_file + *
info->current_pos -
info->request_pos;
531 return info->request_pos;
539 return info->pos_in_file;
546 return *
info->current_end - *
info->current_pos;
553#define MALLOC_OVERHEAD 8
556#define RECORD_CACHE_SIZE (uint)(64 * 1024 - MALLOC_OVERHEAD)
567extern int my_copy(
const char *from,
const char *to,
myf MyFlags);
577extern File my_create(
const char *FileName,
int CreateFlags,
int AccessFlags,
586 int createflags,
int access_flags,
592extern int my_symlink(
const char *content,
const char *linkname,
myf MyFlags);
597extern int my_rename(
const char *from,
const char *to,
myf MyFlags);
613#define MAX_SYSLOG_MESSAGE_SIZE 1024
618extern int my_openlog(
const char *eventSourceName,
int option,
int facility);
626#define my_access access
634 bool allow_current_dir);
636#define is_filename_allowed(name, length, allow_cwd) (true)
640extern int nt_share_delete(
const char *
name,
myf MyFlags);
641#define my_delete_allow_opened(fname, flags) nt_share_delete((fname), (flags))
643#define my_delete_allow_opened(fname, flags) my_delete((fname), (flags))
662 void (*after_sync)(
void));
668 MY_ATTRIBUTE((format(printf, 2, 4)));
670 va_list ap) MY_ATTRIBUTE((format(printf, 2, 0)));
691template <class... Ts>
698extern void my_end(
int infoflag);
707extern size_t dirname_part(
char *to,
const char *
name,
size_t *to_res_length);
709#define base_name(A) (A + dirname_length(A))
712extern char *
convert_dirname(
char *to,
const char *from,
const char *from_end);
718 const char *form, uint
flag);
726extern char *
my_path(
char *to,
const char *progname,
727 const char *own_pathname_part);
729 const char *own_path_prefix);
737 bool use_async_io,
myf cache_myflags,
741 bool use_async_io,
myf cache_myflags);
743 my_off_t seek_offset,
bool use_async_io,
749 IO_CACHE *write_cache, uint num_threads);
761#define flush_io_cache(info) my_b_flush_io_cache((info), 1)
769 MY_ATTRIBUTE((format(printf, 2, 3)));
781const size_t MY_MAX_TEMP_FILENAME_LEN = 19;
788 uint element_size,
void *init_buffer,
789 uint init_alloc, uint alloc_increment);
792#define dynamic_element(array, array_index, type) \
793 ((type)((array)->buffer) + (array_index))
807 const uint quote_len,
const char *append, ...);
812#define alloc_root_inited(A) ((A)->inited())
821 const uchar *packet,
size_t *len,
828#ifdef HAVE_SYS_MMAN_H
840#define MAP_NORESERVE 0
844#define my_mmap(a, b, c, d, e, f) mmap64(a, b, c, d, e, f)
846#define my_mmap(a, b, c, d, e, f) mmap(a, b, c, d, e, f)
848#define my_munmap(a, b) munmap((a), (b))
854#define MAP_NORESERVE 0
855#define MAP_SHARED 0x0001
856#define MAP_PRIVATE 0x0002
857#define MAP_NOSYNC 0x0800
858#define MAP_FAILED ((void *)-1)
859#define MS_SYNC 0x0000
868 return getpagesize();
872 return (
int)si.dwPageSize;
876int my_msync(
int,
void *,
size_t,
int);
899 char *to,
size_t to_length,
900 const char *from,
size_t length);
907 size_t to_length,
const char *from,
908 size_t length,
char quote);
910extern bool have_tcpip;
914int my_security_attr_create(SECURITY_ATTRIBUTES **psa,
const char **perror,
915 DWORD owner_rights, DWORD everybody_rights);
917void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
922 size_t mbbufsize,
size_t *nread);
923void my_win_console_write(
const CHARSET_INFO *
cs,
const char *data,
925void my_win_console_fputs(
const CHARSET_INFO *
cs,
const char *data);
927void my_win_console_vfprintf(
const CHARSET_INFO *
cs,
const char *fmt,
929int my_win_translate_command_line_args(
const CHARSET_INFO *
cs,
int *ac,
933#ifdef HAVE_PSI_INTERFACE
User-specified callback interface for collation parser/initializer.
Definition: m_ctype.h:189
This abstract class represents the interface of a replication logs encryption cipher that can be used...
Definition: stream_cipher.h:77
static MEM_ROOT mem_root
Definition: client_plugin.cc:113
my_off_t my_b_tell(const IO_CACHE *info)
Definition: my_sys.h:526
char * my_strerror(char *buf, size_t len, int errnum)
Get a string describing a system or handler error.
Definition: my_error.cc:109
void set_psi_file_service(void *psi)
Definition: psi_noop.cc:441
PSI_file_key key_file_io_cache
Definition: mf_iocache.cc:91
void(* my_error_vreporter)(enum loglevel level, uint ecode, va_list)
Definition: my_sys.h:482
MYSQL_PLUGIN_IMPORT PSI_thread_bootstrap * psi_thread_hook
Definition: psi_noop.cc:244
int my_sync(File fd, myf my_flags)
Definition: my_sync.cc:84
int _my_b_read_r(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:922
size_t normalize_dirname(char *to, const char *from)
Convert a directory name to a format which can be compared as strings.
Definition: mf_pack.cc:202
void my_message_local_stderr(enum loglevel, uint ecode, va_list args)
Issue a message locally (i.e.
Definition: my_error.cc:443
ulong my_tmp_file_created
Definition: my_static.cc:85
void charset_uninit()
Definition: charset.cc:581
my_error_vreporter my_charset_error_reporter
Definition: charset.cc:122
cache_type
Definition: my_sys.h:284
int check_if_legal_filename(const char *path)
void my_message(uint my_err, const char *str, myf MyFlags)
Print an error message.
Definition: my_error.cc:310
uchar * my_compress_alloc(mysql_compress_context *comp_ctx, const uchar *packet, size_t *len, size_t *complen)
Definition: my_compress.cc:294
void set_psi_mdl_service(void *psi)
Definition: psi_noop.cc:582
int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
Change size of file.
Definition: my_chsize.cc:65
MYSQL_PLUGIN_IMPORT const CHARSET_INFO * all_charsets[MY_ALL_CHARSETS_SIZE]
Definition: charset.cc:179
void remove_io_thread(IO_CACHE *info)
Definition: mf_iocache.cc:670
PSI_memory_key key_memory_max_alloca
Definition: my_static.cc:65
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:215
int my_delete_with_symlink(const char *name, myf MyFlags)
Definition: my_symlink2.cc:126
std::atomic< ErrorHandlerFunctionPointer > error_handler_hook
Definition: my_static.cc:167
#define my_access
Definition: my_sys.h:626
const char * my_get_err_msg(int nr)
Get an error format string from one of the my_error_register()ed sets.
Definition: my_error.cc:183
size_t my_b_get_bytes_in_buffer(const IO_CACHE *info)
Definition: my_sys.h:534
my_off_t my_b_get_pos_in_file(const IO_CACHE *info)
Definition: my_sys.h:538
void set_psi_tls_channel_service(void *psi)
Definition: psi_noop.cc:1006
void set_psi_mutex_service(void *psi)
Definition: psi_noop.cc:278
void * my_multi_malloc(PSI_memory_key key, myf flags,...)
Definition: mulalloc.cc:58
void my_printf_error(uint my_err, const char *format, myf MyFlags,...)
Print an error message.
Definition: my_error.cc:264
size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length)
Definition: mf_iocache2.cc:189
bool my_compress(mysql_compress_context *, uchar *, size_t *, size_t *)
This replaces the packet with a compressed packet.
Definition: my_compress.cc:279
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:285
#define MYSYS_STRERROR_SIZE
Definition: my_sys.h:116
void * alloc_dynamic(DYNAMIC_ARRAY *array)
Definition: array.cc:140
ulong my_default_record_cache_size
Definition: my_static.cc:161
MYSQL_PLUGIN_IMPORT PSI_stage_bootstrap * psi_stage_hook
Definition: psi_noop.cc:623
int _my_b_net_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Read buffered from the net.
Definition: mf_iocache.cc:60
my_off_t my_get_ptr(uchar *ptr, size_t pack_length)
Definition: ptr_cmp.cc:75
void set_psi_system_service(void *psi)
Definition: psi_noop.cc:987
size_t dirname_part(char *to, const char *name, size_t *to_res_length)
Gives directory part of filename.
Definition: mf_dirname.cc:163
bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, size_t length)
Definition: my_string.cc:98
bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc)
Definition: my_string.cc:45
int my_rename(const char *from, const char *to, myf MyFlags)
Definition: my_rename.cc:46
CHARSET_INFO * get_charset_by_name(const char *cs_name, myf flags)
Definition: charset.cc:276
void(* exit_cond_hook)(void *opaque_thd, const PSI_stage_info *stage, const char *src_function, const char *src_file, int src_line)
Definition: my_static.cc:205
int test_if_hard_path(const char *dir_name)
Definition: my_getwd.cc:136
void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, IO_CACHE *write_cache, uint num_threads)
Definition: mf_iocache.cc:619
int my_block_write(IO_CACHE *info, const uchar *Buffer, size_t Count, my_off_t pos)
Definition: mf_iocache.cc:1375
int my_fallocator(File fd, my_off_t newlength, int filler, myf MyFlags)
Change size of the specified file.
Definition: my_fallocator.cc:70
MYSQL_PLUGIN_IMPORT PSI_transaction_bootstrap * psi_transaction_hook
Definition: psi_noop.cc:899
MYSQL_PLUGIN_IMPORT ulong my_thread_stack_size
Definition: my_init.cc:95
CHARSET_INFO * get_charset(uint cs_number, myf flags)
Definition: charset.cc:230
File my_create(const char *FileName, int CreateFlags, int AccessFlags, myf MyFlags)
Create a new file.
Definition: my_create.cc:63
void set_psi_memory_service(void *psi)
Definition: psi_noop.cc:954
int my_setwd(const char *dir, myf MyFlags)
Definition: my_getwd.cc:105
int my_b_append(IO_CACHE *info, const uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1319
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 ...
Definition: my_read.cc:72
void close_cached_file(IO_CACHE *cache)
Definition: mf_cache.cc:86
int my_error_register(const char *(*get_errmsg)(int), int first, int last)
Register error messages for use with my_error().
Definition: my_error.cc:332
File my_fileno(FILE *stream)
Portable fileno() wrapper.
Definition: my_fstream.cc:180
char * my_once_strdup(const char *src, myf myflags)
Definition: my_once.cc:99
MYSQL_PLUGIN_IMPORT PSI_error_bootstrap * psi_error_hook
Definition: psi_noop.cc:912
bool my_init_dynamic_array(DYNAMIC_ARRAY *array, PSI_memory_key key, uint element_size, void *init_buffer, uint init_alloc, uint alloc_increment)
Definition: array.cc:68
my_off_t my_fseek(FILE *stream, my_off_t pos, int whence)
Seek to position in FILE stream.
Definition: my_fstream.cc:156
my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
Seek to a position in a file.
Definition: my_seek.cc:68
File my_open(const char *filename, int Flags, myf MyFlags)
Open a file.
Definition: my_open.cc:65
char * strdup_root(MEM_ROOT *root, const char *str)
Definition: my_alloc.cc:277
size_t my_b_printf(IO_CACHE *info, const char *fmt,...)
Simple printf version.
Definition: mf_iocache2.cc:236
size_t strlength(const char *str)
Calculate the length of str not including any trailing ' '-bytes.
Definition: mf_format.cc:155
File create_temp_file(char *to, const char *dir, const char *pfx, int mode, UnlinkOrKeepFile unlink_or_keep, myf MyFlags)
Definition: mf_tempfile.cc:219
void my_b_seek(IO_CACHE *info, my_off_t pos)
Definition: mf_iocache2.cc:93
my_off_t my_b_filelength(IO_CACHE *info)
Definition: mf_iocache2.cc:218
my_off_t my_ftell(FILE *stream)
Portable ftell() wrapper.
Definition: my_fstream.cc:165
ulong my_file_opened
Definition: my_static.cc:88
int check_if_legal_tablename(const char *path)
Definition: my_access.cc:158
char * convert_dirname(char *to, const char *from, const char *from_end)
Convert directory name to use under this system.
Definition: mf_dirname.cc:206
bool my_error_unregister(int first, int last)
Unregister formerly registered error messages.
Definition: my_error.cc:378
my_off_t my_tell(File fd, myf MyFlags)
Definition: my_seek.cc:93
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)
Definition: mf_iocache.cc:175
#define MY_ALL_CHARSETS_SIZE
Definition: my_sys.h:264
bool dynstr_trunc(DYNAMIC_STRING *str, size_t n)
Definition: my_string.cc:115
void(*)(uint, const char *, myf) ErrorHandlerFunctionPointer
Definition: my_sys.h:226
int my_getwd(char *buf, size_t size, myf MyFlags)
Definition: my_getwd.cc:77
char * my_tmpdir(MY_TMPDIR *tmpdir)
Definition: mf_tempdir.cc:104
int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1083
char * fn_same(char *toname, const char *name, int flag)
Definition: mf_same.cc:45
void to_unix_path(char *name)
Convert filename to unix style filename.
Definition: mf_unixpath.cc:43
void * memdup_root(MEM_ROOT *root, const void *str, size_t len)
Definition: my_alloc.cc:294
void set_psi_socket_service(void *psi)
Definition: psi_noop.cc:487
void set_psi_table_service(void *psi)
Definition: psi_noop.cc:545
void dynstr_free(DYNAMIC_STRING *str)
Definition: my_string.cc:187
int(* qsort2_cmp)(const void *, const void *, const void *)
Definition: my_sys.h:470
#define my_mmap(a, b, c, d, e, f)
Definition: my_sys.h:844
char * get_charsets_dir(char *buf)
Definition: charset.cc:160
uint my_get_large_page_size(void)
Definition: my_largepage.cc:48
int my_closelog()
Closes/de-registers the system logging handle.
Definition: my_syslog.cc:327
void my_b_clear(IO_CACHE *info)
Definition: my_sys.h:490
MYSQL_PLUGIN_IMPORT PSI_tls_channel_bootstrap * psi_tls_channel_hook
Definition: psi_noop.cc:1003
bool dynstr_set(DYNAMIC_STRING *str, const char *init_str)
Definition: my_string.cc:61
bool my_b_inited(const IO_CACHE *info)
Definition: my_sys.h:492
void set_psi_error_service(void *psi)
Definition: psi_noop.cc:915
size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags)
Read a chunk of bytes from a file from a given position.
Definition: my_pread.cc:78
size_t unpack_filename(char *to, const char *from)
Fix filename so it can be used by open, create.
Definition: mf_pack.cc:324
MYSQL_PLUGIN_IMPORT PSI_memory_bootstrap * psi_memory_hook
Definition: psi_noop.cc:951
MYSQL_PLUGIN_IMPORT CHARSET_INFO * default_charset_info
Definition: charset.cc:180
size_t system_filename(char *to, const char *from)
Convert filename (unix standard) to system standard Used before system command's like open(),...
Definition: mf_pack.cc:356
int my_delete(const char *name, myf MyFlags)
Definition: my_delete.cc:45
#define is_filename_allowed(name, length, allow_cwd)
Definition: my_sys.h:636
const char * get_global_errmsg(int nr)
Definition: errors.cc:176
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, ...).
Definition: charset.cc:375
const char * my_filename(File fd)
Get filename of file.
Definition: my_file.cc:246
bool my_enable_symlinks
Definition: my_sys.h:280
MYSQL_PLUGIN_IMPORT PSI_table_bootstrap * psi_table_hook
Definition: psi_noop.cc:542
void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
Print an error message.
Definition: my_error.cc:289
int my_symlink(const char *content, const char *linkname, myf MyFlags)
Definition: my_symlink.cc:98
void free_tmpdir(MY_TMPDIR *tmpdir)
Definition: mf_tempdir.cc:114
int my_b_get(IO_CACHE *info)
Definition: my_sys.h:518
bool dynstr_append(DYNAMIC_STRING *str, const char *append)
Definition: my_string.cc:94
int my_is_symlink(const char *filename, ST_FILE_ID *file_id)
Definition: my_symlink.cc:115
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, ...).
Definition: charset.cc:347
void MyOsError(int errno_val, Ts... ppck)
Convenience wrapper for OS error messages which report errno/my_errno with d followed by strerror as ...
Definition: my_sys.h:692
int my_b_safe_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1358
bool my_init(void)
Initialize my_sys functions, resources and variables.
Definition: my_init.cc:133
bool init_compiled_charsets(myf flags)
void my_message_local(enum loglevel ll, uint ecode,...)
Issue a message locally (i.e.
Definition: my_error.cc:472
size_t cleanup_dirname(char *to, const char *from)
Remove unwanted chars from dirname.
Definition: mf_pack.cc:78
size_t my_b_vprintf(IO_CACHE *info, const char *fmt, va_list ap)
Implementation of my_b_printf.
Definition: mf_iocache2.cc:254
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.
Definition: mf_arr_appstr.cc:50
void(* local_message_hook)(enum loglevel ll, uint ecode, va_list args)
Definition: my_static.cc:169
void set_psi_idle_service(void *psi)
Definition: psi_noop.cc:601
bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element)
Definition: array.cc:111
int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
Definition: my_symlink2.cc:153
void * my_once_alloc(size_t Size, myf MyFlags)
Definition: my_once.cc:61
int my_b_write(IO_CACHE *info, const uchar *buffer, size_t count)
Definition: my_sys.h:507
void * my_once_memdup(const void *src, size_t len, myf myflags)
Definition: my_once.cc:106
int(* IO_CACHE_CALLBACK)(IO_CACHE *)
Definition: my_sys.h:325
size_t my_b_bytes_in_cache(const IO_CACHE *info)
Definition: my_sys.h:545
FILE * my_fdopen(File fd, const char *filename, int Flags, myf MyFlags)
Make a stream out of a file handle.
Definition: my_fopen.cc:216
uint my_set_max_open_files(uint files)
Sets the OS limit on the number of open files (if supported).
Definition: my_file.cc:268
File my_create_with_symlink(const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags)
Definition: my_symlink2.cc:53
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...
Definition: mf_format.cc:72
const char * my_progname
Definition: my_static.cc:82
MYSQL_PLUGIN_IMPORT PSI_statement_bootstrap * psi_statement_hook
Definition: psi_noop.cc:832
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 ...
Definition: my_symlink.cc:185
size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
Write a chunk of bytes to a FILE stream.
Definition: my_fstream.cc:102
uint get_charset_number(const char *cs_name, uint cs_flags)
Definition: charset.cc:204
bool dynstr_append_quoted(DYNAMIC_STRING *str, const char *quote_str, const uint quote_len, const char *append,...)
Definition: my_string.cc:178
void setup_io_cache(IO_CACHE *info)
Definition: mf_iocache.cc:116
size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
Write a chunk of bytes to a file.
Definition: my_write.cc:78
int my_copy(const char *from, const char *to, myf MyFlags)
Definition: my_copy.cc:78
int my_close(File fd, myf MyFlags)
Close a file.
Definition: my_open.cc:98
MYSQL_PLUGIN_IMPORT PSI_idle_bootstrap * psi_idle_hook
Definition: psi_noop.cc:598
bool my_uncompress(mysql_compress_context *, uchar *, size_t, size_t *)
Uncompress packet.
Definition: my_compress.cc:323
UnlinkOrKeepFile
Definition: my_sys.h:777
int my_umask_dir
Definition: my_static.cc:158
ulong my_stream_opened
Definition: my_static.cc:87
void my_init_mysys_psi_keys(void)
Definition: my_init.cc:576
MY_MODE get_file_perm(ulong perm_flags)
Definition: my_chmod.cc:52
#define my_munmap(a, b)
Definition: my_sys.h:848
int _my_b_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:423
bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,...)
Definition: my_string.cc:163
MYSQL_PLUGIN_IMPORT PSI_file_bootstrap * psi_file_hook
Definition: psi_noop.cc:438
MYSQL_PLUGIN_IMPORT PSI_data_lock_bootstrap * psi_data_lock_hook
Definition: psi_noop.cc:971
int my_msync(int, void *, size_t, int)
Definition: my_mmap.cc:50
size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length, char quote)
Definition: charset.cc:538
size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags)
Read a chunk of bytes from a FILE stream.
Definition: my_fstream.cc:72
int my_b_read(IO_CACHE *info, uchar *buffer, size_t count)
Definition: my_sys.h:498
int my_b_copy_to_file(IO_CACHE *cache, FILE *file)
Definition: mf_iocache2.cc:71
size_t unpack_dirname(char *to, const char *from)
Fixes a directory name so that can be used by open().
Definition: mf_pack.cc:252
ulong my_file_total_opened
Definition: my_static.cc:89
int my_openlog(const char *eventSourceName, int option, int facility)
Opens/Registers a new handle for system logging.
Definition: my_syslog.cc:285
void(* set_waiting_for_disk_space_hook)(void *opaque_thd, bool waiting)
Definition: my_static.cc:211
CHARSET_INFO * get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags)
Definition: charset.cc:325
MYSQL_PLUGIN_IMPORT PSI_rwlock_bootstrap * psi_rwlock_hook
Definition: psi_noop.cc:319
int end_io_cache(IO_CACHE *info)
Definition: mf_iocache.cc:1519
size_t dirname_length(const char *name)
Get the string length of the directory part of name, including the last FN_LIBCHAR.
Definition: mf_dirname.cc:61
void delete_dynamic(DYNAMIC_ARRAY *array)
Definition: array.cc:175
void set_psi_data_lock_service(void *psi)
Definition: psi_noop.cc:974
my_syslog_options
Definition: my_sys.h:616
MYSQL_PLUGIN_IMPORT PSI_cond_bootstrap * psi_cond_hook
Definition: psi_noop.cc:351
bool has_path(const char *name)
Definition: my_getwd.cc:159
size_t escape_string_for_mysql(const CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length)
Definition: charset.cc:412
CHARSET_INFO * my_collation_get_by_name(const char *collation_name, myf flags, MY_CHARSET_ERRMSG *)
Find collation by name: extended version of get_charset_by_name() to return error messages to the cal...
Definition: charset.cc:262
void set_psi_cond_service(void *psi)
Definition: psi_noop.cc:354
void * multi_alloc_root(MEM_ROOT *mem_root,...)
Definition: my_alloc.cc:249
char * intern_filename(char *to, const char *from)
Fix a filename to intern (UNIX format).
Definition: mf_pack.cc:376
int _my_b_get(IO_CACHE *info)
Definition: mf_iocache.cc:1219
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos)
Definition: ptr_cmp.cc:43
bool my_init_done
Definition: my_init.cc:94
void set_psi_rwlock_service(void *psi)
Definition: psi_noop.cc:322
const char * get_collation_name(uint charset_number)
Definition: charset.cc:217
constexpr int my_b_EOF
Definition: my_sys.h:496
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)
Definition: mf_iocache.cc:311
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)
Definition: my_static.cc:201
MYSQL_PLUGIN_IMPORT int my_umask
Definition: my_static.cc:158
bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
Definition: mf_tempdir.cc:50
bool my_gethwaddr(uchar *to)
Definition: my_gethwaddr.cc:237
uint get_collation_number(const char *name)
Definition: charset.cc:198
int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
Definition: mf_iocache.cc:1430
int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1238
char * safe_strdup_root(MEM_ROOT *root, const char *str)
Definition: my_alloc.cc:281
int my_realpath(char *to, const char *filename, myf MyFlags)
Definition: my_symlink.cc:138
bool my_disable_locking
Definition: my_static.cc:225
CHARSET_INFO * my_charset_get_by_name(const char *name, uint cs_flags, myf my_flags, MY_CHARSET_ERRMSG *)
Find character set by name: extended version of get_charset_by_csname() to return error messages to t...
Definition: charset.cc:291
bool real_open_cached_file(IO_CACHE *cache)
Definition: mf_cache.cc:74
int(* is_killed_hook)(const void *opaque_thd)
Definition: my_static.cc:214
int my_syslog(const CHARSET_INFO *cs, enum loglevel level, const char *msg)
Sends message to the system logger.
Definition: my_syslog.cc:96
void set_psi_thread_service(void *psi)
Definition: psi_noop.cc:247
MYSQL_PLUGIN_IMPORT PSI_socket_bootstrap * psi_socket_hook
Definition: psi_noop.cc:484
void my_end(int infoflag)
Definition: my_init.cc:176
bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size)
Definition: my_string.cc:80
char * home_dir
Definition: my_static.cc:81
bool reinit_io_cache(IO_CACHE *info, enum cache_type type, my_off_t seek_offset, bool use_async_io, bool clear_cache)
Definition: mf_iocache.cc:327
void my_message_stderr(uint my_err, const char *str, myf MyFlags)
Print an error message on stderr.
Definition: my_mess.cc:59
FILE * my_freopen(const char *filename, const char *mode, FILE *stream)
Change the file associated with a file stream.
Definition: my_fopen.cc:155
FILE * my_fopen(const char *filename, int Flags, myf MyFlags)
Open a file as stream.
Definition: my_fopen.cc:108
uchar * my_b_get_buffer_start(const IO_CACHE *info)
Definition: my_sys.h:530
bool my_chmod(const char *filename, ulong perm_flags, myf my_flags)
Definition: my_chmod.cc:88
int my_mkdir(const char *dir, int Flags, myf MyFlags)
Definition: my_mkdir.cc:44
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.
Definition: my_pread.cc:140
void set_psi_stage_service(void *psi)
Definition: psi_noop.cc:626
MYSQL_PLUGIN_IMPORT PSI_system_bootstrap * psi_system_hook
Definition: psi_noop.cc:984
MYSQL_PLUGIN_IMPORT PSI_mdl_bootstrap * psi_mdl_hook
Definition: psi_noop.cc:579
bool open_cached_file(IO_CACHE *cache, const char *dir, const char *prefix, size_t cache_size, myf cache_myflags)
Definition: mf_cache.cc:52
int my_fclose(FILE *stream, myf MyFlags)
Close a stream.
Definition: my_fopen.cc:174
void set_psi_statement_service(void *psi)
Definition: psi_noop.cc:835
void set_psi_transaction_service(void *psi)
Definition: psi_noop.cc:902
void my_once_free(void)
Definition: my_once.cc:119
size_t my_b_fill(IO_CACHE *info)
Definition: mf_iocache2.cc:147
const char * charsets_dir
Definition: charset.cc:126
char * my_path(char *to, const char *progname, const char *own_pathname_part)
Definition: mf_path.cc:63
MYSQL_PLUGIN_IMPORT PSI_mutex_bootstrap * psi_mutex_hook
Definition: psi_noop.cc:275
void(* my_error_reporter)(enum loglevel level, uint ecode,...)
Definition: my_sys.h:481
char * my_load_path(char *to, const char *path, const char *own_path_prefix)
Returns full load-path for a file.
Definition: mf_loadpath.cc:63
void wait_for_free_space(const char *filename, int errors)
Definition: errors.cc:153
void thr_set_sync_wait_callback(void(*before_sync)(void), void(*after_sync)(void))
Definition: my_sync.cc:55
int my_readlink(char *to, const char *filename, myf MyFlags)
Definition: my_symlink.cc:66
static int my_getpagesize()
Definition: my_sys.h:866
char * fn_ext(char *name)
Definition: mf_fn_ext.cc:71
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)
Definition: my_static.cc:208
flush_type
Definition: my_sys.h:294
@ SEQ_READ_APPEND
Definition: my_sys.h:288
@ TYPE_NOT_SET
Definition: my_sys.h:285
@ READ_NET
Definition: my_sys.h:290
@ WRITE_CACHE
Definition: my_sys.h:287
@ WRITE_NET
Definition: my_sys.h:291
@ READ_CACHE
Definition: my_sys.h:286
@ READ_FIFO
Definition: my_sys.h:289
@ UNLINK_FILE
Definition: my_sys.h:777
@ KEEP_FILE
Definition: my_sys.h:777
@ MY_SYSLOG_PIDS
Definition: my_sys.h:616
@ FLUSH_KEEP
Definition: my_sys.h:295
@ FLUSH_RELEASE
Definition: my_sys.h:296
@ FLUSH_FORCE_WRITE
Definition: my_sys.h:302
@ FLUSH_IGNORE_CHANGED
Definition: my_sys.h:297
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:47
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:48
static int flags[50]
Definition: hp_test1.cc:39
static int flag
Definition: hp_test1.cc:39
static const char * whence(const Item_field *cached_field)
Get the name of the cached field of an Item_cache_json instance.
Definition: item.cc:10002
Header for compiler-dependent features.
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:93
ulonglong my_off_t
Definition: my_inttypes.h:71
unsigned char uchar
Definition: my_inttypes.h:51
Types to make file and socket I/O compatible.
mode_t MY_MODE
Definition: my_io_bits.h:57
int File
Definition: my_io_bits.h:50
Definition of the global "loglevel" enumeration.
loglevel
Definition: my_loglevel.h:40
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
size_t mysql_encryption_file_write(IO_CACHE *cache, const uchar *buffer, size_t count, myf flags)
This is a wrapper around mysql_file_write.
Definition: mf_iocache.cc:1655
my_off_t mysql_encryption_file_seek(IO_CACHE *cache, my_off_t pos, int whence, myf flags)
This is a wrapper around mysql_file_seek.
Definition: mf_iocache.cc:1640
bool binlog_cache_temporary_file_is_encrypted
(end of group MYSYS)
Definition: mf_iocache.cc:93
size_t mysql_encryption_file_read(IO_CACHE *cache, uchar *buffer, size_t count, myf flags)
This is a wrapper around mysql_file_read.
Definition: mf_iocache.cc:1647
void my_osmaperr(unsigned long oserrno)
Definition: my_winerr.cc:123
HANDLE my_get_osfhandle(File fd)
Return the Windows HANDLE for a file descriptor obtained from RegisterHandle().
Definition: my_winfile.cc:407
static int count
Definition: myisam_ftdump.cc:44
static const CHARSET_INFO * charset_info
Definition: mysql.cc:246
Instrumentation helpers for conditions.
ABI for instrumented mutexes.
static char * path
Definition: mysqldump.cc:140
char * collation_name
Definition: audit_api_message_emit.cc:184
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1063
Definition: buf0block_hint.cc:29
const std::string FILE("FILE")
Definition: commit_order_queue.h:33
std::string dir
Double write files location.
Definition: buf0dblwr.cc:76
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:75
int last_error()
get last socket error.
Definition: socket_error.h:81
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:419
mode
Definition: file_handle.h:59
const char * filename
Definition: pfs_example_component_population.cc:66
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
required string type
Definition: replication_group_member_actions.proto:33
case opt name
Definition: sslopt-case.h:32
This file includes core components for encrypting/decrypting binary log files.
Definition: m_ctype.h:422
uchar * buffer
Definition: my_sys.h:306
uint elements
Definition: my_sys.h:307
uint size_of_element
Definition: my_sys.h:309
uint alloc_increment
Definition: my_sys.h:308
uint max_element
Definition: my_sys.h:307
PSI_memory_key m_psi_key
Definition: my_sys.h:310
char * str
Definition: my_sys.h:320
size_t length
Definition: my_sys.h:321
size_t max_length
Definition: my_sys.h:321
int running_threads
Definition: my_sys.h:337
int error
Definition: my_sys.h:339
mysql_mutex_t mutex
Definition: my_sys.h:328
uchar * read_end
Definition: my_sys.h:336
my_off_t pos_in_file
Definition: my_sys.h:332
int total_threads
Definition: my_sys.h:338
mysql_cond_t cond_writer
Definition: my_sys.h:330
mysql_cond_t cond
Definition: my_sys.h:329
IO_CACHE * source_cache
Definition: my_sys.h:334
uchar * buffer
Definition: my_sys.h:335
uchar * write_buffer
Definition: my_sys.h:361
uchar * read_pos
Definition: my_sys.h:353
my_off_t pos_in_file
Definition: my_sys.h:345
my_off_t end_of_file
Definition: my_sys.h:351
uchar * read_end
Definition: my_sys.h:355
uchar ** current_end
Definition: my_sys.h:380
ulong disk_writes
Definition: my_sys.h:431
IO_CACHE_CALLBACK post_read
Definition: my_sys.h:424
myf myflags
Definition: my_sys.h:451
void * arg
Definition: my_sys.h:432
uchar * buffer
Definition: my_sys.h:356
bool seek_not_done
Definition: my_sys.h:445
uchar * write_pos
Definition: my_sys.h:370
uchar ** current_pos
Definition: my_sys.h:380
PSI_file_key file_key
Definition: my_sys.h:436
int(* write_function)(IO_CACHE *, const uchar *, size_t)
Definition: my_sys.h:409
char * file_name
Definition: my_sys.h:433
uchar * append_read_pos
Definition: my_sys.h:368
uint disk_sync_delay
Definition: my_sys.h:467
uchar * request_pos
Definition: my_sys.h:358
size_t buffer_length
Definition: my_sys.h:448
int(* read_function)(IO_CACHE *, uchar *, size_t)
Definition: my_sys.h:404
char * dir
Definition: my_sys.h:434
bool alloced_buffer
Definition: my_sys.h:458
uchar * write_end
Definition: my_sys.h:372
Stream_cipher * m_encryptor
Definition: my_sys.h:460
char * prefix
Definition: my_sys.h:434
Stream_cipher * m_decryptor
Definition: my_sys.h:462
IO_CACHE_CALLBACK pre_close
Definition: my_sys.h:425
int error
Definition: my_sys.h:446
IO_CACHE_SHARE * share
Definition: my_sys.h:394
cache_type type
Definition: my_sys.h:415
size_t read_length
Definition: my_sys.h:450
IO_CACHE_CALLBACK pre_read
Definition: my_sys.h:423
mysql_mutex_t append_buffer_lock
Definition: my_sys.h:386
bool disk_sync
Definition: my_sys.h:464
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Helper structure to return error messages from collation parser/initializer.
Definition: m_ctype.h:180
char ** list
Definition: my_sys.h:314
uint max
Definition: my_sys.h:315
uint cur
Definition: my_sys.h:315
mysql_mutex_t mutex
Definition: my_sys.h:316
Entry point for the performance schema interface.
Definition: psi_cond.h:45
Entry point for the performance schema interface.
Definition: psi_data_lock.h:81
Entry point for the performance schema interface.
Definition: psi_error.h:58
Entry point for the performance schema interface.
Definition: psi_file.h:65
Entry point for the performance schema interface.
Definition: psi_idle.h:59
Entry point for the performance schema interface.
Definition: psi_mdl.h:67
Entry point for the performance schema interface.
Definition: psi_memory.h:84
Entry point for the performance schema interface.
Definition: psi_mutex.h:45
Entry point for the performance schema interface.
Definition: psi_rwlock.h:52
Entry point for the performance schema interface.
Definition: psi_socket.h:51
Entry point for the performance schema interface.
Definition: psi_stage.h:45
Stage instrument information.
Definition: psi_stage_bits.h:73
Entry point for the performance schema interface.
Definition: psi_statement.h:45
Entry point for the performance schema interface.
Definition: psi_system.h:59
Entry point for the performance schema interface.
Definition: psi_table.h:59
Entry point for the performance schema interface.
Definition: psi_thread.h:101
Entry point for the performance schema interface.
Definition: psi_tls_channel.h:45
Entry point for the performance schema interface.
Definition: psi_transaction.h:59
dev_t st_dev
Definition: my_sys.h:477
ino_t st_ino
Definition: my_sys.h:478
struct for once_alloc (block)
Definition: my_sys.h:559
unsigned int size
size of block
Definition: my_sys.h:562
unsigned int left
memory left in block
Definition: my_sys.h:561
USED_MEM * next
Next block in use.
Definition: my_sys.h:560
Compression context information.
Definition: my_compress.h:73
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
Include file for Sun RPC to compile out of the box.
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:41
#define HANDLE
Definition: violite.h:158
int n
Definition: xcom_base.cc:508
static uint64_t cache_size
Definition: xcom_cache.cc:361