MySQL 26.10.0
Source Code Documentation
my_sys.h
Go to the documentation of this file.
1/* Copyright (c) 2000, 2026, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef _my_sys_h
25#define _my_sys_h
26
27/**
28 @defgroup MYSYS Mysys - low level utilities for MySQL
29 @ingroup Runtime_Environment
30 @{
31 @file include/my_sys.h Common header for many mysys elements.
32 @note Many mysys implementation files now have their own header file.
33*/
34
35#include "my_config.h"
36
37#ifdef HAVE_ALLOCA_H
38#include <alloca.h>
39#endif
40#include <limits.h>
41#ifdef _WIN32
42#include <malloc.h>
43#endif
44#ifdef HAVE_UNISTD_H
45#include <unistd.h>
46#endif
47#include <stdarg.h>
48#include <stdio.h>
49#ifdef HAVE_SYS_SELECT_H
50#include <sys/select.h>
51#endif
52#include <sys/types.h>
53#include <time.h>
54
55#include <atomic> // error_handler_hook
56#include <cstring>
57#include <optional>
58#include <string>
59
60#include "my_clone.h"
61#include "my_compiler.h"
62#include "my_compress.h"
63#include "my_inttypes.h"
64#include "my_server_version.h"
65#include "mysql/my_loglevel.h"
66
67/* HAVE_PSI_*_INTERFACE */
68#include "my_psi_config.h" /* IWYU pragma: keep */
69
70#include "my_sharedlib.h"
71// IWYU pragma: begin_exports
82// IWYU pragma: end_exports
83#include "string_with_len.h"
84
85/**
86 Resolve a stack address suitable for stack-usage accounting.
87
88 In ordinary builds, @p local_marker is returned unchanged. Callers
89 normally pass the address of a local variable, which represents the
90 current stack location on platforms without AddressSanitizer's fake
91 stack.
92
93 In ASan builds, local variables can be relocated to ASan's fake stack.
94 Such an address cannot be compared with a thread's physical stack
95 origin, so the marker is intentionally ignored and a physical address
96 from the current frame is returned instead.
97
98 @param local_marker Conventional local stack marker supplied by the
99 caller. It is used only outside ASan builds.
100 @returns A stack address that is comparable with the THD stack base.
101*/
103 [[maybe_unused]] const void *local_marker) {
104#ifdef HAVE_ASAN
105#if defined(__GNUC__) || defined(__clang__)
106 return static_cast<const char *>(__builtin_frame_address(0));
107#else /* Not GCC/Clang */
108 return static_cast<const char *>(local_marker);
109#endif
110#else /* Not ASAN */
111 return static_cast<const char *>(local_marker);
112#endif
113}
114
116
117struct CHARSET_INFO;
118struct MY_CHARSET_ERRMSG;
119
120struct PSI_cond_bootstrap;
123struct PSI_file_bootstrap;
124struct PSI_idle_bootstrap;
126struct PSI_mdl_bootstrap;
139struct MEM_ROOT;
140
141#define MY_INIT(name) \
142 { \
143 my_progname = name; \
144 my_init(); \
145 }
146
147/**
148 Max length of an error message generated by mysys utilities.
149 Some mysys functions produce error messages. These mostly go
150 to stderr.
151 This constant defines the size of the buffer used to format
152 the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
153 since sometimes mysys errors are stored in the server diagnostics
154 area, and we would like to avoid unexpected truncation.
155*/
156#define MYSYS_ERRMSG_SIZE (512)
157#define MYSYS_STRERROR_SIZE (128)
158
159#define MY_FILE_ERROR ((size_t)-1)
160
161/* General bitmaps for my_func's */
162// 1 used to be MY_FFNF which has been removed
163#define MY_FNABP 2 /* Fatal if not all bytes read/written */
164#define MY_NABP 4 /* Error if not all bytes read/written */
165#define MY_FAE 8 /* Fatal if any error */
166#define MY_WME 16 /* Write message on error */
167#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
168#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
169#define MY_REPORT_WAITING_IF_FULL 64 /* my_write: set status as waiting */
170#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
171#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
172#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
173#define MY_COPYTIME 64 /* my_redel() copies time */
174#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
175#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
176#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
177#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
178#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
179#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
180#define MY_ALLOW_ZERO_PTR 64 /* my_realloc() ; zero ptr -> malloc */
181#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
182#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
183#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
184#define MY_SYNC 4096 /* my_copy(): sync dst file */
185
186#define MYF_RW MYF(MY_WME + MY_NABP) /* For my_read & my_write */
187
188#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
189#define MY_GIVE_INFO 2 /* Give time info about process*/
190#define MY_DONT_FREE_DBUG 4 /* Do not call DBUG_END() in my_end() */
191#define MY_END_PROXY_MAIN_THD 8 /* Free resources for main thread */
192
193/* Flags for my_error() */
194#define ME_BELL 4 /* DEPRECATED: Ring bell then printing message */
195#define ME_ERRORLOG 64 /* Write the error message to error log */
196#define ME_FATALERROR 1024 /* Fatal statement error */
197
198/* Bits in last argument to fn_format */
199#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
200#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */
201#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */
202/* 8 Unused. Previously used for MY_PACK_FILENAME. */
203#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */
204#define MY_RETURN_REAL_PATH 32 /* return full path for file */
205#define MY_SAFE_PATH 64 /* Return NULL if too long path */
206#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
207#define MY_APPEND_EXT 256 /* add 'ext' as additional extension*/
208
209/* My seek flags */
210#define MY_SEEK_SET 0
211#define MY_SEEK_CUR 1
212#define MY_SEEK_END 2
213
214/* Some constants */
215#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */
216#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */
217#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */
218#define DFLT_INIT_HITS 3
219
220/* Internal error numbers (for assembler functions) */
221#define MY_ERRNO_EDOM 33
222#define MY_ERRNO_ERANGE 34
223
224/* defines when allocating data */
225extern void *my_multi_malloc(PSI_memory_key key, myf flags, ...);
226
227/*
228 Switch to my_malloc() if the memory block to be allocated is bigger than
229 max_alloca_sz.
230*/
232#define my_safe_alloca(size, max_alloca_sz) \
233 ((size <= max_alloca_sz) ? my_alloca(size) \
234 : my_malloc(key_memory_max_alloca, size, MYF(0)))
235#define my_safe_afree(ptr, size, max_alloca_sz) \
236 if (size > max_alloca_sz) my_free(ptr)
237
238#if defined(ENABLED_DEBUG_SYNC)
239using DebugSyncCallbackFp = void (*)(const char *, size_t);
240extern DebugSyncCallbackFp debug_sync_C_callback_ptr;
241
242#define DEBUG_SYNC_C(_sync_point_name_) \
243 do { \
244 if (debug_sync_C_callback_ptr != NULL) \
245 (*debug_sync_C_callback_ptr)(STRING_WITH_LEN(_sync_point_name_)); \
246 } while (0)
247#else
248#define DEBUG_SYNC_C(_sync_point_name_)
249#endif /* defined(ENABLED_DEBUG_SYNC) */
250
251#ifdef HAVE_LINUX_LARGE_PAGES
252extern uint my_get_large_page_size(void);
253#else
254#define my_get_large_page_size() (0)
255#endif /* HAVE_LINUX_LARGE_PAGES */
256
257#define my_alloca(SZ) alloca((size_t)(SZ))
258
259extern char *home_dir; /* Home directory for user */
260extern const char *my_progname; /* program-name (printed in errors) */
261
262using ErrorHandlerFunctionPointer = void (*)(uint, const char *, myf);
263extern std::atomic<ErrorHandlerFunctionPointer> error_handler_hook;
264extern void (*local_message_hook)(enum loglevel ll, uint ecode, va_list args);
265
267
268/*
269 Hooks for reporting execution stage information. The server implementation
270 of these will also set THD::current_cond/current_mutex.
271 By having hooks, we avoid direct dependencies on server code.
272*/
273extern void (*enter_cond_hook)(void *opaque_thd, mysql_cond_t *cond,
274 mysql_mutex_t *mutex,
275 const PSI_stage_info *stage,
276 PSI_stage_info *old_stage,
277 const char *src_function, const char *src_file,
278 int src_line);
279
280extern void (*exit_cond_hook)(void *opaque_thd, const PSI_stage_info *stage,
281 const char *src_function, const char *src_file,
282 int src_line);
283
284extern void (*enter_stage_hook)(void *opaque_thd,
285 const PSI_stage_info *new_stage,
286 PSI_stage_info *old_stage,
287 const char *src_function, const char *src_file,
288 int src_line);
289
290/*
291 Hook for setting THD waiting_for_disk_space flag.
292*/
293extern void (*set_waiting_for_disk_space_hook)(void *opaque_thd, bool waiting);
294/*
295 Hook for checking if the thread has been killed.
296*/
297extern int (*is_killed_hook)(const void *opaque_thd);
298
299/* charsets */
300#define MY_ALL_CHARSETS_SIZE 2048
304
305/* statistics */
306extern ulong my_tmp_file_created;
307extern ulong my_file_opened;
308extern ulong my_stream_opened;
309extern ulong my_file_total_opened;
310extern bool my_init_done;
311
312extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
313extern int my_umask_dir;
314
317
318extern const char *charsets_dir;
319
324 SEQ_READ_APPEND /* sequential read or append */,
329
331 FLUSH_KEEP, /* flush block and keep it in the cache */
332 FLUSH_RELEASE, /* flush block and remove it from the cache */
333 FLUSH_IGNORE_CHANGED, /* remove block from the cache */
334 /*
335 As my_disable_flush_pagecache_blocks is always 0, the following option
336 is strictly equivalent to FLUSH_KEEP
337 */
340
341struct MY_TMPDIR {
342 char **list{nullptr};
343 uint cur{0}, max{0};
345};
346
348 char *str;
350};
351
352struct IO_CACHE;
353typedef int (*IO_CACHE_CALLBACK)(IO_CACHE *);
354
356 mysql_mutex_t mutex; /* To sync on reads into buffer. */
357 mysql_cond_t cond; /* To wait for signals. */
358 mysql_cond_t cond_writer; /* For a synchronized writer. */
359 /* Offset in file corresponding to the first byte of buffer. */
361 /* If a synchronized write cache is the source of the data. */
363 uchar *buffer; /* The read buffer. */
364 uchar *read_end; /* Behind last valid byte of buffer. */
365 int running_threads; /* threads not in lock. */
366 int total_threads; /* threads sharing the cache. */
367 int error; /* Last error. */
368};
369
370class Stream_cipher;
371struct IO_CACHE /* Used when caching files */
372{
373 /* Offset in file corresponding to the first byte of uchar* buffer. */
375 /*
376 The offset of end of file for READ_CACHE and WRITE_CACHE.
377 For SEQ_READ_APPEND it the maximum of the actual end of file and
378 the position represented by read_end.
379 */
381 /* Points to current read position in the buffer */
382 uchar *read_pos{nullptr};
383 /* the non-inclusive boundary in the buffer for the currently valid read */
384 uchar *read_end{nullptr};
385 uchar *buffer{nullptr}; /* The read buffer */
386 /* Used in ASYNC_IO */
388
389 /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
391 /*
392 Only used in SEQ_READ_APPEND, and points to the current read position
393 in the write buffer. Note that reads in SEQ_READ_APPEND caches can
394 happen from both read buffer (uchar* buffer) and write buffer
395 (uchar* write_buffer).
396 */
398 /* Points to current write position in the write buffer */
399 uchar *write_pos{nullptr};
400 /* The non-inclusive boundary of the valid write area */
401 uchar *write_end{nullptr};
402
403 /*
404 Current_pos and current_end are convenience variables used by
405 my_b_tell() and other routines that need to know the current offset
406 current_pos points to &write_pos, and current_end to &write_end in a
407 WRITE_CACHE, and &read_pos and &read_end respectively otherwise
408 */
409 uchar **current_pos{nullptr}, **current_end{nullptr};
410
411 /*
412 The lock is for append buffer used in SEQ_READ_APPEND cache
413 need mutex copying from append buffer to read buffer.
414 */
416 /*
417 The following is used when several threads are reading the
418 same file in parallel. They are synchronized on disk
419 accesses reading the cached part of the file asynchronously.
420 It should be set to NULL to disable the feature. Only
421 READ_CACHE mode is supported.
422 */
424
425 /*
426 A caller will use my_b_read() macro to read from the cache
427 if the data is already in cache, it will be simply copied with
428 memcpy() and internal variables will be accordinging updated with
429 no functions invoked. However, if the data is not fully in the cache,
430 my_b_read() will call read_function to fetch the data. read_function
431 must never be invoked directly.
432 */
433 int (*read_function)(IO_CACHE *, uchar *, size_t){nullptr};
434 /*
435 Same idea as in the case of read_function, except my_b_write() needs to
436 be replaced with my_b_append() for a SEQ_READ_APPEND cache
437 */
438 int (*write_function)(IO_CACHE *, const uchar *, size_t){nullptr};
439 /*
440 Specifies the type of the cache. Depending on the type of the cache
441 certain operations might not be available and yield unpredictable
442 results. Details to be documented later
443 */
445 /*
446 Callbacks when the actual read I/O happens. These were added and
447 are currently used for binary logging of LOAD DATA INFILE - when a
448 block is read from the file, we create a block create/append event, and
449 when IO_CACHE is closed, we create an end event. These functions could,
450 of course be used for other things
451 */
455 /*
456 Counts the number of times, when we were forced to use disk. We use it to
457 increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status
458 variables.
459 */
460 ulong disk_writes{0};
461 void *arg{nullptr}; /* for use by pre/post_read */
462 char *file_name{nullptr}; /* if used with 'open_cached_file' */
463 char *dir{nullptr}, *prefix{nullptr};
464 File file{-1}; /* file descriptor */
465 PSI_file_key file_key{PSI_NOT_INSTRUMENTED}; /* instrumented file key */
466
467 /*
468 seek_not_done is set by my_b_seek() to inform the upcoming read/write
469 operation that a seek needs to be performed prior to the actual I/O
470 error is 0 if the cache operation was successful, -1 if there was a
471 "hard" error, and the actual number of I/O-ed bytes if the read/write was
472 partial.
473 */
474 bool seek_not_done{false};
475 int error{0};
476 /* buffer_length is memory size allocated for buffer or write_buffer */
477 size_t buffer_length{0};
478 /* read_length is the same as buffer_length except when we use async io */
479 size_t read_length{0};
480 myf myflags{0}; /* Flags used to my_read/my_write */
481 /*
482 alloced_buffer is 1 if the buffer was allocated by init_io_cache() and
483 0 if it was supplied by the user.
484 Currently READ_NET is the only one that will use a buffer allocated
485 somewhere else
486 */
487 bool alloced_buffer{false};
488 // This is an encryptor for encrypting the temporary file of the IO cache.
490 // This is a decryptor for decrypting the temporary file of the IO cache.
492 // Synchronize flushed buffer with disk.
493 bool disk_sync{false};
494 // Delay in milliseconds after disk synchronization of the flushed buffer.
495 // Requires disk_sync = true.
497};
498
499typedef int (*qsort2_cmp)(const void *, const void *, const void *);
500
501/*
502 Subset of struct stat fields filled by stat/lstat/fstat that uniquely
503 identify a file
504*/
506 dev_t st_dev;
507 ino_t st_ino;
508};
509
510typedef void (*my_error_reporter)(enum loglevel level, uint ecode, ...);
511typedef void (*my_error_vreporter)(enum loglevel level, uint ecode, va_list);
512
514
515/* defines for mf_iocache */
517
518/* Test if buffer is inited */
519inline void my_b_clear(IO_CACHE *info) { info->buffer = nullptr; }
520
521inline bool my_b_inited(const IO_CACHE *info) {
522 return info->buffer != nullptr;
523}
524
525constexpr int my_b_EOF = INT_MIN;
526
527inline int my_b_read(IO_CACHE *info, uchar *buffer, size_t count) {
528 assert(info->type != WRITE_CACHE);
529 if (info->read_pos + count <= info->read_end) {
530 memcpy(buffer, info->read_pos, count);
531 info->read_pos += count;
532 return 0;
533 }
534 return (*info->read_function)(info, buffer, count);
535}
536
537inline int my_b_write(IO_CACHE *info, const uchar *buffer, size_t count) {
538 assert(info->type != READ_CACHE);
539 if (info->write_pos + count <= info->write_end) {
540 memcpy(info->write_pos, buffer, count);
541 info->write_pos += count;
542 return 0;
543 }
544 return (*info->write_function)(info, buffer, count);
545}
546
547extern int _my_b_get(IO_CACHE *info);
548
549inline int my_b_get(IO_CACHE *info) {
550 if (info->read_pos != info->read_end) {
551 info->read_pos++;
552 return info->read_pos[-1];
553 }
554 return _my_b_get(info);
555}
556
557inline my_off_t my_b_tell(const IO_CACHE *info) {
558 return info->pos_in_file + *info->current_pos - info->request_pos;
559}
560
562 return info->request_pos;
563}
564
565inline size_t my_b_get_bytes_in_buffer(const IO_CACHE *info) {
566 return info->read_end - my_b_get_buffer_start(info);
567}
568
570 return info->pos_in_file;
571}
572
573/* tell write offset in the SEQ_APPEND cache */
574int my_b_copy_to_file(IO_CACHE *cache, FILE *file);
575
576inline size_t my_b_bytes_in_cache(const IO_CACHE *info) {
577 return *info->current_end - *info->current_pos;
578}
579
580/*
581 How much overhead does malloc have. The code often allocates
582 something like 1024-MALLOC_OVERHEAD bytes
583*/
584#define MALLOC_OVERHEAD 8
585
586/* Typical record cache */
587#define RECORD_CACHE_SIZE (uint)(64 * 1024 - MALLOC_OVERHEAD)
588
589/** struct for once_alloc (block) */
590struct USED_MEM {
591 USED_MEM *next; /**< Next block in use */
592 unsigned int left; /**< memory left in block */
593 unsigned int size; /**< size of block */
594};
595
596/* Prototypes for mysys and my_func functions */
597
599 char *to, size_t to_length,
600 const char *from, size_t length);
601
602extern int my_copy(const char *from, const char *to, myf MyFlags);
603extern int my_delete(const char *name, myf MyFlags);
604extern int my_getwd(char *buf, size_t size, myf MyFlags);
605extern int my_setwd(const char *dir, myf MyFlags);
606extern void *my_once_alloc(size_t Size, myf MyFlags);
607extern void my_once_free(void);
608extern char *my_once_strdup(const char *src, myf myflags);
609extern void *my_once_memdup(const void *src, size_t len, myf myflags);
610extern File my_open(const char *filename, int Flags, myf MyFlags);
611
612extern File my_create(const char *FileName, int CreateFlags, int AccessFlags,
613 myf MyFlags);
614extern int my_close(File fd, myf MyFlags);
615extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
616extern int my_readlink(char *to, const char *filename, myf MyFlags);
617extern int my_is_symlink(const char *filename, ST_FILE_ID *file_id);
618extern bool my_rm_dir_w_symlink(const char *directory_path, bool send_error,
619 bool send_intermediate_errors,
620 bool &directory_deletion_failed);
621extern int my_realpath(char *to, const char *filename, myf MyFlags);
622extern int my_is_same_file(File file, const ST_FILE_ID *file_id);
623extern File my_create_with_symlink(const char *linkname, const char *filename,
624 int createflags, int access_flags,
625 myf MyFlags);
626extern int my_delete_with_symlink(const char *name, myf MyFlags);
627extern int my_rename_with_symlink(const char *from, const char *to,
628 myf MyFlags);
629#ifndef _WIN32
630extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
631#endif
632extern size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags);
633extern size_t my_pread(File Filedes, uchar *Buffer, size_t Count,
634 my_off_t offset, myf MyFlags);
635extern int my_rename(const char *from, const char *to, myf MyFlags);
636extern my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags);
637extern my_off_t my_tell(File fd, myf MyFlags);
638extern size_t my_write(File Filedes, const uchar *Buffer, size_t Count,
639 myf MyFlags);
640extern size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
641 my_off_t offset, myf MyFlags);
642extern size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags);
643extern size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count,
644 myf MyFlags);
645extern my_off_t my_fseek(FILE *stream, my_off_t pos, int whence);
646extern my_off_t my_ftell(FILE *stream);
647
648/* implemented in my_syslog.c */
649
650// Maximum size of message that will be logged.
651#define MAX_SYSLOG_MESSAGE_SIZE 1024
652
653extern int my_openlog(const char *eventSourceName, int option, int facility);
654extern int my_closelog();
655extern int my_syslog(const CHARSET_INFO *cs, enum loglevel level,
656 const char *msg);
657
658#ifdef _WIN32
659extern int my_access(const char *path, int amode);
660#else
661#define my_access access
662#endif
663
664extern int check_if_legal_filename(const char *path);
665extern int check_if_legal_tablename(const char *path);
666
667#ifdef _WIN32
668extern bool is_filename_allowed(const char *name, size_t length,
669 bool allow_current_dir);
670#else /* _WIN32 */
671#define is_filename_allowed(name, length, allow_cwd) (true)
672#endif /* _WIN32 */
673
674#ifdef _WIN32
675extern int nt_share_delete(const char *name, myf MyFlags);
676#define my_delete_allow_opened(fname, flags) nt_share_delete((fname), (flags))
677#else
678#define my_delete_allow_opened(fname, flags) my_delete((fname), (flags))
679#endif
680
681#ifdef _WIN32
682/* Windows-only functions (CRT equivalents)*/
683extern HANDLE my_get_osfhandle(File fd);
684extern void my_osmaperr(unsigned long last_error);
685#endif
686
687extern const char *get_global_errmsg(int nr);
688extern void wait_for_free_space(const char *filename, int errors);
689extern FILE *my_fopen(const char *filename, int Flags, myf MyFlags);
690extern FILE *my_fdopen(File fd, const char *filename, int Flags, myf MyFlags);
691extern FILE *my_freopen(const char *filename, const char *mode, FILE *stream);
692extern int my_fclose(FILE *stream, myf MyFlags);
693extern File my_fileno(FILE *stream);
694extern int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags);
695extern int my_fallocator(File fd, my_off_t newlength, int filler, myf MyFlags);
696extern void thr_set_sync_wait_callback(void (*before_sync)(void),
697 void (*after_sync)(void));
698extern int my_sync(File fd, myf my_flags);
699extern char *my_strerror(char *buf, size_t len, int errnum);
700extern const char *my_get_err_msg(int nr);
701extern void my_error(int nr, myf MyFlags, ...);
702extern void my_printf_error(uint my_err, const char *format, myf MyFlags, ...)
703 MY_ATTRIBUTE((format(printf, 2, 4)));
704extern void my_printv_error(uint error, const char *format, myf MyFlags,
705 va_list ap) MY_ATTRIBUTE((format(printf, 2, 0)));
706extern int my_error_register(const char *(*get_errmsg)(int), int first,
707 int last);
708extern bool my_error_unregister(int first, int last);
709extern void my_message(uint my_err, const char *str, myf MyFlags);
710extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
711void my_message_local_stderr(enum loglevel, uint ecode, va_list args);
712extern void my_message_local(enum loglevel ll, uint ecode, ...);
713
714/**
715 Convenience wrapper for OS error messages which report
716 errno/my_errno with %d followed by strerror as %s, as the last
717 conversions in the error message.
718
719 The OS error message (my_errno) is formatted in a stack buffer and
720 the errno value and a pointer to the buffer is added to the end of
721 the parameter pack passed to my_error().
722
723 @param errno_val errno/my_errno number.
724 @param ppck parameter pack of additional arguments to pass to my_error().
725 */
726template <class... Ts>
727inline void MyOsError(int errno_val, Ts... ppck) {
728 char errbuf[MYSYS_STRERROR_SIZE];
729 my_error(ppck..., errno_val, my_strerror(errbuf, sizeof(errbuf), errno_val));
730}
731
732extern bool my_init(void);
733extern void my_end(int infoflag);
734extern const char *my_filename(File fd);
735extern MY_MODE get_file_perm(ulong perm_flags);
736extern bool my_chmod(const char *filename, ulong perm_flags, myf my_flags);
737
738extern bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
739extern char *my_tmpdir(MY_TMPDIR *tmpdir);
740extern void free_tmpdir(MY_TMPDIR *tmpdir);
741
742extern size_t dirname_part(char *to, const char *name, size_t *to_res_length);
743extern size_t dirname_length(const char *name);
744ALWAYS_INLINE const char *base_name(const char *A) {
745 return A + dirname_length(A);
746}
747extern int test_if_hard_path(const char *dir_name);
748extern bool has_path(const char *name);
749extern char *convert_dirname(char *to, const char *from, const char *from_end);
750extern void to_unix_path(char *name);
751extern char *fn_ext(char *name);
752extern const char *fn_ext(const char *name);
753extern char *fn_same(char *toname, const char *name, int flag);
754extern char *fn_format(char *to, const char *name, const char *dir,
755 const char *form, uint flag);
756extern size_t strlength(const char *str);
757extern size_t normalize_dirname(char *to, const char *from);
758extern size_t unpack_dirname(char *to, const char *from);
759extern size_t cleanup_dirname(char *to, const char *from);
760extern size_t system_filename(char *to, const char *from);
761extern size_t unpack_filename(char *to, const char *from);
762extern char *intern_filename(char *to, const char *from);
763extern char *my_path(char *to, const char *progname,
764 const char *own_pathname_part);
765extern char *my_load_path(char *to, const char *path,
766 const char *own_path_prefix);
767extern bool array_append_string_unique(const char *str, const char **array,
768 size_t size);
769
770void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
771my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
772extern int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize,
773 enum cache_type type, my_off_t seek_offset,
774 bool use_async_io, myf cache_myflags,
775 PSI_file_key file_key);
776extern int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
777 enum cache_type type, my_off_t seek_offset,
778 bool use_async_io, myf cache_myflags);
779extern bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
780 my_off_t seek_offset, bool use_async_io,
781 bool clear_cache);
782extern void setup_io_cache(IO_CACHE *info);
783extern int _my_b_read(IO_CACHE *info, uchar *Buffer, size_t Count);
784extern int _my_b_read_r(IO_CACHE *info, uchar *Buffer, size_t Count);
785extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
786 IO_CACHE *write_cache, uint num_threads);
787extern void remove_io_thread(IO_CACHE *info);
788extern int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count);
789extern int _my_b_net_read(IO_CACHE *info, uchar *Buffer, size_t Count);
790extern int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count);
791extern int my_b_append(IO_CACHE *info, const uchar *Buffer, size_t Count);
792extern int my_b_safe_write(IO_CACHE *info, const uchar *Buffer, size_t Count);
793
794extern int my_block_write(IO_CACHE *info, const uchar *Buffer, size_t Count,
795 my_off_t pos);
796extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
797
798#define flush_io_cache(info) my_b_flush_io_cache((info), 1)
799
800extern int end_io_cache(IO_CACHE *info);
801extern size_t my_b_fill(IO_CACHE *info);
802extern void my_b_seek(IO_CACHE *info, my_off_t pos);
803extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
804extern my_off_t my_b_filelength(IO_CACHE *info);
805extern size_t my_b_printf(IO_CACHE *info, const char *fmt, ...)
806 MY_ATTRIBUTE((format(printf, 2, 3)));
807extern size_t my_b_vprintf(IO_CACHE *info, const char *fmt, va_list ap);
808extern bool open_cached_file(IO_CACHE *cache, const char *dir,
809 const char *prefix, size_t cache_size,
810 myf cache_myflags);
811extern bool real_open_cached_file(IO_CACHE *cache);
812extern void close_cached_file(IO_CACHE *cache);
813
815#ifdef WIN32
816// Maximum temporary filename length is 3 chars for prefix + 16 chars for base
817// 32 encoded UUID (excluding MAC address)
818const size_t MY_MAX_TEMP_FILENAME_LEN = 19;
819#endif
820File create_temp_file(char *to, const char *dir, const char *pfx, int mode,
821 UnlinkOrKeepFile unlink_or_keep, myf MyFlags);
822
823extern bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
824 size_t init_alloc);
825extern bool dynstr_append(DYNAMIC_STRING *str, const char *append);
826bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, size_t length);
827extern bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
828 ...);
829extern bool dynstr_append_quoted(DYNAMIC_STRING *str, const char *quote_str,
830 const uint quote_len, const char *append, ...);
831extern bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
832extern bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
833extern bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
834extern void dynstr_free(DYNAMIC_STRING *str);
835#define alloc_root_inited(A) ((A)->inited())
836extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
837extern char *strdup_root(MEM_ROOT *root, const char *str);
838extern char *safe_strdup_root(MEM_ROOT *root, const char *str);
839extern char *strmake_root(MEM_ROOT *root, const char *str, size_t len);
840extern void *memdup_root(MEM_ROOT *root, const void *str, size_t len);
841extern bool my_compress(mysql_compress_context *, uchar *, size_t *, size_t *);
842extern bool my_uncompress(mysql_compress_context *, uchar *, size_t, size_t *);
844 const uchar *packet, size_t *len,
845 size_t *complen);
846
847extern uint my_set_max_open_files(uint files);
848
849extern bool my_gethwaddr(uchar *to);
850
851#ifdef HAVE_SYS_MMAN_H
852#include <sys/mman.h>
853
854#ifndef MAP_NOSYNC
855#define MAP_NOSYNC 0
856#endif
857
858/*
859 Not defined in FreeBSD 11.
860 Was never implemented in FreeBSD, so we just set it to 0.
861*/
862#ifndef MAP_NORESERVE
863#define MAP_NORESERVE 0
864#endif
865
866#ifdef HAVE_MMAP64
867#define my_mmap(a, b, c, d, e, f) mmap64(a, b, c, d, e, f)
868#else
869#define my_mmap(a, b, c, d, e, f) mmap(a, b, c, d, e, f)
870#endif
871#define my_munmap(a, b) munmap((a), (b))
872
873#else
874/* not a complete set of mmap() flags, but only those that nesessary */
875#define PROT_READ 1
876#define PROT_WRITE 2
877#define MAP_NORESERVE 0
878#define MAP_SHARED 0x0001
879#define MAP_PRIVATE 0x0002
880#define MAP_NOSYNC 0x0800
881#define MAP_FAILED ((void *)-1)
882#define MS_SYNC 0x0000
883
884void *my_mmap(void *, size_t, int, int, int, my_off_t);
885int my_munmap(void *, size_t);
886#endif
887
888/* my_getpagesize */
889static inline int my_getpagesize() {
890#ifndef _WIN32
891 return getpagesize();
892#else
893 SYSTEM_INFO si;
894 GetSystemInfo(&si);
895 return (int)si.dwPageSize;
896#endif
897}
898
899int my_msync(int, void *, size_t, int);
900
901/* character sets */
902extern uint get_charset_number(const char *cs_name, uint cs_flags);
903extern uint get_collation_number(const char *name);
904extern const char *get_collation_name(uint charset_number);
905
906extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
910extern CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint cs_flags,
911 myf my_flags);
912extern CHARSET_INFO *my_charset_get_by_name(const char *name, uint cs_flags,
913 myf my_flags, MY_CHARSET_ERRMSG *);
914extern bool resolve_charset(const char *cs_name, const CHARSET_INFO *default_cs,
915 const CHARSET_INFO **cs);
916extern bool resolve_collation(const char *cl_name,
917 const CHARSET_INFO *default_cl,
918 const CHARSET_INFO **cl);
919extern char *get_charsets_dir(char *buf);
920
921extern void charset_uninit();
922#ifdef _WIN32
923/* File system character set */
924extern CHARSET_INFO *fs_character_set(void);
925
926extern bool have_tcpip; /* Is set if tcpip is used */
927
928/* implemented in my_windac.c */
929
930int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
931 DWORD owner_rights, DWORD everybody_rights);
932
933void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
934
935/* implemented in my_conio.c */
936bool my_win_is_console(FILE *file);
937char *my_win_console_readline(const CHARSET_INFO *cs, char *mbbuf,
938 size_t mbbufsize, size_t *nread);
939void my_win_console_write(const CHARSET_INFO *cs, const char *data,
940 size_t datalen);
941void my_win_console_fputs(const CHARSET_INFO *cs, const char *data);
942void my_win_console_putc(const CHARSET_INFO *cs, int c);
943void my_win_console_vfprintf(const CHARSET_INFO *cs, const char *fmt,
944 va_list args);
945int my_win_translate_command_line_args(const CHARSET_INFO *cs, int *ac,
946 char ***av);
947#endif /* _WIN32 */
948
949#ifdef HAVE_PSI_INTERFACE
950void my_init_mysys_psi_keys(void);
951
953extern void set_psi_cond_service(void *psi);
955extern void set_psi_data_lock_service(void *psi);
957extern void set_psi_error_service(void *psi);
959extern void set_psi_file_service(void *psi);
961extern void set_psi_idle_service(void *psi);
963extern void set_psi_mdl_service(void *psi);
965extern void set_psi_memory_service(void *psi);
967extern void set_psi_metric_service(void *psi);
969extern void set_psi_logs_client_service(void *psi);
971extern void set_psi_mutex_service(void *psi);
973extern void set_psi_rwlock_service(void *psi);
975extern void set_psi_socket_service(void *psi);
977extern void set_psi_stage_service(void *psi);
979extern void set_psi_statement_service(void *psi);
981extern void set_psi_system_service(void *psi);
983extern void set_psi_table_service(void *psi);
985extern void set_psi_thread_service(void *psi);
987extern void set_psi_transaction_service(void *psi);
989extern void set_psi_tls_channel_service(void *psi);
990#endif /* HAVE_PSI_INTERFACE */
991
992/**
993 @} (end of group MYSYS)
994*/
995
996// True if the temporary file of binlog cache is encrypted.
997#ifndef NDEBUG
999#endif
1000
1001/**
1002 This is a wrapper around mysql_file_seek. Seek to a position in the
1003 temporary file of a binlog cache, and set the encryption/decryption
1004 stream offset if binlog_encryption is on.
1005
1006 @param cache The handler of a binlog cache to seek.
1007 @param pos The expected position (absolute or relative)
1008 @param whence A direction parameter and one of
1009 {SEEK_SET, SEEK_CUR, SEEK_END}
1010 @param flags The bitmap of different flags
1011 MY_WME | MY_FAE | MY_NABP | MY_FNABP |
1012 MY_DONT_CHECK_FILESIZE and so on.
1013
1014 @retval The new position in the file, or MY_FILEPOS_ERROR on error.
1015*/
1017 myf flags);
1018/**
1019 This is a wrapper around mysql_file_read. Read data from the temporary
1020 file of a binlog cache, and take care of decrypting the data if
1021 binlog_encryption is on.
1022
1023
1024 @param cache The handler of a binlog cache to read.
1025 @param[out] buffer The memory buffer to write to.
1026 @param count The length of data in the temporary file to be read in bytes.
1027 @param flags The bitmap of different flags
1028 MY_WME | MY_FAE | MY_NABP | MY_FNABP |
1029 MY_DONT_CHECK_FILESIZE and so on.
1030
1031 @retval The length of bytes to be read, or MY_FILE_ERROR on error.
1032*/
1033size_t mysql_encryption_file_read(IO_CACHE *cache, uchar *buffer, size_t count,
1034 myf flags);
1035/**
1036 This is a wrapper around mysql_file_write. Write data in buffer to the
1037 temporary file of a binlog cache, and take care of encrypting the data
1038 if binlog_encryption is on.
1039
1040 @param cache The handler of a binlog cache to write.
1041 @param buffer The memory buffer to write from.
1042 @param count The length of data in buffer to be written in bytes.
1043 @param flags The bitmap of different flags
1044 MY_WME | MY_FAE | MY_NABP | MY_FNABP |
1045 MY_DONT_CHECK_FILESIZE and so on
1046
1047 @return The number of bytes written
1048*/
1049size_t mysql_encryption_file_write(IO_CACHE *cache, const uchar *buffer,
1050 size_t count, myf flags);
1051#endif /* _my_sys_h */
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:84
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
my_off_t my_b_tell(const IO_CACHE *info)
Definition: my_sys.h:557
char * my_strerror(char *buf, size_t len, int errnum)
Get a string describing a system or handler error.
Definition: my_error.cc:111
void set_psi_file_service(void *psi)
Definition: psi_noop.cc:429
PSI_file_key key_file_io_cache
Definition: mf_iocache.cc:85
void(* my_error_vreporter)(enum loglevel level, uint ecode, va_list)
Definition: my_sys.h:511
MYSQL_PLUGIN_IMPORT PSI_thread_bootstrap * psi_thread_hook
Definition: psi_noop.cc:250
CHARSET_INFO * get_charset_by_name(const char *collation_name, myf flags)
Definition: charset.cc:395
int my_sync(File fd, myf my_flags)
Definition: my_sync.cc:80
int _my_b_read_r(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:916
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:203
void my_message_local_stderr(enum loglevel, uint ecode, va_list args)
Issue a message locally (i.e.
Definition: my_error.cc:445
ulong my_tmp_file_created
Definition: my_static.cc:84
void charset_uninit()
Definition: charset.cc:543
my_error_vreporter my_charset_error_reporter
Definition: charset.cc:135
cache_type
Definition: my_sys.h:320
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:312
uchar * my_compress_alloc(mysql_compress_context *comp_ctx, const uchar *packet, size_t *len, size_t *complen)
Definition: my_compress.cc:295
void set_psi_mdl_service(void *psi)
Definition: psi_noop.cc:565
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:192
void remove_io_thread(IO_CACHE *info)
Definition: mf_iocache.cc:664
PSI_memory_key key_memory_max_alloca
Definition: my_static.cc:64
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:217
int my_delete_with_symlink(const char *name, myf MyFlags)
Definition: my_symlink2.cc:127
std::atomic< ErrorHandlerFunctionPointer > error_handler_hook
Definition: my_static.cc:166
#define my_access
Definition: my_sys.h:661
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:185
size_t my_b_get_bytes_in_buffer(const IO_CACHE *info)
Definition: my_sys.h:565
my_off_t my_b_get_pos_in_file(const IO_CACHE *info)
Definition: my_sys.h:569
void set_psi_tls_channel_service(void *psi)
Definition: psi_noop.cc:915
void set_psi_mutex_service(void *psi)
Definition: psi_noop.cc:284
void * my_multi_malloc(PSI_memory_key key, myf flags,...)
Definition: mulalloc.cc:59
void my_printf_error(uint my_err, const char *format, myf MyFlags,...)
Print an error message.
Definition: my_error.cc:266
size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length)
Definition: mf_iocache2.cc:191
bool my_compress(mysql_compress_context *, uchar *, size_t *, size_t *)
This replaces the packet with a compressed packet.
Definition: my_compress.cc:280
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:287
#define MYSYS_STRERROR_SIZE
Definition: my_sys.h:157
ulong my_default_record_cache_size
Definition: my_static.cc:160
MYSQL_PLUGIN_IMPORT PSI_stage_bootstrap * psi_stage_hook
Definition: psi_noop.cc:604
MYSQL_PLUGIN_IMPORT PSI_metric_bootstrap * psi_metric_hook
Definition: psi_noop.cc:938
int _my_b_net_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Read buffered from the net.
Definition: mf_iocache.cc:61
my_off_t my_get_ptr(uchar *ptr, size_t pack_length)
Definition: ptr_cmp.cc:71
void set_psi_system_service(void *psi)
Definition: psi_noop.cc:900
size_t dirname_part(char *to, const char *name, size_t *to_res_length)
Gives directory part of filename.
Definition: mf_dirname.cc:164
bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, size_t length)
Definition: my_string.cc:100
bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc)
Definition: my_string.cc:47
int my_rename(const char *from, const char *to, myf MyFlags)
Definition: my_rename.cc:46
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:204
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:613
int my_block_write(IO_CACHE *info, const uchar *Buffer, size_t Count, my_off_t pos)
Definition: mf_iocache.cc:1369
int my_fallocator(File fd, my_off_t newlength, int filler, myf MyFlags)
Change size of the specified file.
Definition: my_fallocator.cc:66
MYSQL_PLUGIN_IMPORT PSI_transaction_bootstrap * psi_transaction_hook
Definition: psi_noop.cc:820
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:243
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:871
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:1313
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:73
void close_cached_file(IO_CACHE *cache)
Definition: mf_cache.cc:87
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:334
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:833
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:70
File my_open(const char *filename, int Flags, myf MyFlags)
Open a file.
Definition: my_open.cc:60
char * strdup_root(MEM_ROOT *root, const char *str)
Definition: my_alloc.cc:279
size_t my_b_printf(IO_CACHE *info, const char *fmt,...)
Simple printf version.
Definition: mf_iocache2.cc:238
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:220
void my_b_seek(IO_CACHE *info, my_off_t pos)
Definition: mf_iocache2.cc:95
my_off_t my_b_filelength(IO_CACHE *info)
Definition: mf_iocache2.cc:220
my_off_t my_ftell(FILE *stream)
Portable ftell() wrapper.
Definition: my_fstream.cc:165
ulong my_file_opened
Definition: my_static.cc:87
int check_if_legal_tablename(const char *path)
Definition: my_access.cc:157
char * convert_dirname(char *to, const char *from, const char *from_end)
Convert directory name to use under this system.
Definition: mf_dirname.cc:207
bool my_error_unregister(int first, int last)
Unregister formerly registered error messages.
Definition: my_error.cc:380
my_off_t my_tell(File fd, myf MyFlags)
Definition: my_seek.cc:95
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:169
#define MY_ALL_CHARSETS_SIZE
Definition: my_sys.h:300
bool dynstr_trunc(DYNAMIC_STRING *str, size_t n)
Definition: my_string.cc:117
void(*)(uint, const char *, myf) ErrorHandlerFunctionPointer
Definition: my_sys.h:262
bool my_rm_dir_w_symlink(const char *directory_path, bool send_error, bool send_intermediate_errors, bool &directory_deletion_failed)
Deletes the specified directory.
Definition: my_rm_dir_w_symlink.cc:65
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:111
int _my_b_seq_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1077
char * fn_same(char *toname, const char *name, int flag)
Definition: mf_same.cc:46
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:296
void set_psi_socket_service(void *psi)
Definition: psi_noop.cc:469
void set_psi_table_service(void *psi)
Definition: psi_noop.cc:525
void dynstr_free(DYNAMIC_STRING *str)
Definition: my_string.cc:189
int(* qsort2_cmp)(const void *, const void *, const void *)
Definition: my_sys.h:499
#define my_mmap(a, b, c, d, e, f)
Definition: my_sys.h:867
char * get_charsets_dir(char *buf)
Definition: charset.cc:173
uint my_get_large_page_size(void)
Definition: my_largepage.cc:49
int my_closelog()
Closes/de-registers the system logging handle.
Definition: my_syslog.cc:325
void my_b_clear(IO_CACHE *info)
Definition: my_sys.h:519
void set_psi_logs_client_service(void *psi)
Definition: psi_noop.cc:966
MYSQL_PLUGIN_IMPORT PSI_tls_channel_bootstrap * psi_tls_channel_hook
Definition: psi_noop.cc:912
bool dynstr_set(DYNAMIC_STRING *str, const char *init_str)
Definition: my_string.cc:63
bool my_b_inited(const IO_CACHE *info)
Definition: my_sys.h:521
void set_psi_error_service(void *psi)
Definition: psi_noop.cc:836
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:77
size_t unpack_filename(char *to, const char *from)
Fix filename so it can be used by open, create.
Definition: mf_pack.cc:325
MYSQL_PLUGIN_IMPORT PSI_memory_bootstrap * psi_memory_hook
Definition: psi_noop.cc:868
MYSQL_PLUGIN_IMPORT CHARSET_INFO * default_charset_info
Definition: charset.cc:193
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:357
int my_delete(const char *name, myf MyFlags)
Definition: my_delete.cc:46
#define is_filename_allowed(name, length, allow_cwd)
Definition: my_sys.h:671
const char * get_global_errmsg(int nr)
Definition: errors.cc:180
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:506
const char * my_filename(File fd)
Get filename of file.
Definition: my_file.cc:244
bool my_enable_symlinks
Definition: my_sys.h:316
MYSQL_PLUGIN_IMPORT PSI_table_bootstrap * psi_table_hook
Definition: psi_noop.cc:522
void my_printv_error(uint error, const char *format, myf MyFlags, va_list ap)
Print an error message.
Definition: my_error.cc:291
int my_symlink(const char *content, const char *linkname, myf MyFlags)
Definition: my_symlink.cc:99
void free_tmpdir(MY_TMPDIR *tmpdir)
Definition: mf_tempdir.cc:121
int my_b_get(IO_CACHE *info)
Definition: my_sys.h:549
bool dynstr_append(DYNAMIC_STRING *str, const char *append)
Definition: my_string.cc:96
int my_is_symlink(const char *filename, ST_FILE_ID *file_id)
Definition: my_symlink.cc:116
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:478
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:727
int my_b_safe_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1352
bool my_init(void)
Initialize my_sys functions, resources and variables.
Definition: my_init.cc:133
void my_message_local(enum loglevel ll, uint ecode,...)
Issue a message locally (i.e.
Definition: my_error.cc:475
size_t cleanup_dirname(char *to, const char *from)
Remove unwanted chars from dirname.
Definition: mf_pack.cc:79
size_t my_b_vprintf(IO_CACHE *info, const char *fmt, va_list ap)
Implementation of my_b_printf.
Definition: mf_iocache2.cc:256
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:49
void(* local_message_hook)(enum loglevel ll, uint ecode, va_list args)
Definition: my_static.cc:168
void set_psi_idle_service(void *psi)
Definition: psi_noop.cc:584
int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
Definition: my_symlink2.cc:154
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:537
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:353
size_t my_b_bytes_in_cache(const IO_CACHE *info)
Definition: my_sys.h:576
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:266
File my_create_with_symlink(const char *linkname, const char *filename, int createflags, int access_flags, myf MyFlags)
Definition: my_symlink2.cc:54
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:81
MYSQL_PLUGIN_IMPORT PSI_statement_bootstrap * psi_statement_hook
Definition: psi_noop.cc:769
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:186
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:217
bool dynstr_append_quoted(DYNAMIC_STRING *str, const char *quote_str, const uint quote_len, const char *append,...)
Definition: my_string.cc:180
void setup_io_cache(IO_CACHE *info)
Definition: mf_iocache.cc:110
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:80
int my_copy(const char *from, const char *to, myf MyFlags)
Definition: my_copy.cc:79
int my_close(File fd, myf MyFlags)
Close a file.
Definition: my_open.cc:93
MYSQL_PLUGIN_IMPORT PSI_idle_bootstrap * psi_idle_hook
Definition: psi_noop.cc:581
bool my_uncompress(mysql_compress_context *, uchar *, size_t, size_t *)
Uncompress packet.
Definition: my_compress.cc:324
UnlinkOrKeepFile
Definition: my_sys.h:814
int my_umask_dir
Definition: my_static.cc:157
ulong my_stream_opened
Definition: my_static.cc:86
void my_init_mysys_psi_keys(void)
Definition: my_init.cc:579
MY_MODE get_file_perm(ulong perm_flags)
Definition: my_chmod.cc:53
#define my_munmap(a, b)
Definition: my_sys.h:871
int _my_b_read(IO_CACHE *info, uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:417
bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,...)
Definition: my_string.cc:165
MYSQL_PLUGIN_IMPORT PSI_file_bootstrap * psi_file_hook
Definition: psi_noop.cc:426
MYSQL_PLUGIN_IMPORT PSI_data_lock_bootstrap * psi_data_lock_hook
Definition: psi_noop.cc:884
int my_msync(int, void *, size_t, int)
Definition: my_mmap.cc:50
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:527
int my_b_copy_to_file(IO_CACHE *cache, FILE *file)
Definition: mf_iocache2.cc:73
size_t unpack_dirname(char *to, const char *from)
Fixes a directory name so that can be used by open().
Definition: mf_pack.cc:253
ulong my_file_total_opened
Definition: my_static.cc:88
int my_openlog(const char *eventSourceName, int option, int facility)
Opens/Registers a new handle for system logging.
Definition: my_syslog.cc:283
void(* set_waiting_for_disk_space_hook)(void *opaque_thd, bool waiting)
Definition: my_static.cc:210
CHARSET_INFO * get_charset_by_csname(const char *cs_name, uint cs_flags, myf my_flags)
Definition: charset.cc:456
MYSQL_PLUGIN_IMPORT PSI_rwlock_bootstrap * psi_rwlock_hook
Definition: psi_noop.cc:321
int end_io_cache(IO_CACHE *info)
Definition: mf_iocache.cc:1513
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:62
void set_psi_data_lock_service(void *psi)
Definition: psi_noop.cc:887
MYSQL_PLUGIN_IMPORT PSI_cond_bootstrap * psi_cond_hook
Definition: psi_noop.cc:353
bool has_path(const char *name)
Definition: my_getwd.cc:159
MYSQL_PLUGIN_IMPORT PSI_logs_client_bootstrap * psi_logs_client_hook
Definition: psi_noop.cc:963
size_t escape_string_for_mysql(const CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length)
Definition: escape_string.cc:58
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:344
void set_psi_cond_service(void *psi)
Definition: psi_noop.cc:356
void * multi_alloc_root(MEM_ROOT *mem_root,...)
Definition: my_alloc.cc:251
char * intern_filename(char *to, const char *from)
Fix a filename to intern (UNIX format).
Definition: mf_pack.cc:377
int _my_b_get(IO_CACHE *info)
Definition: mf_iocache.cc:1213
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos)
Definition: ptr_cmp.cc:40
bool my_init_done
Definition: my_init.cc:94
void set_psi_rwlock_service(void *psi)
Definition: psi_noop.cc:324
const char * get_collation_name(uint charset_number)
Definition: charset.cc:230
constexpr int my_b_EOF
Definition: my_sys.h:525
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:305
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:200
MYSQL_PLUGIN_IMPORT int my_umask
Definition: my_static.cc:157
bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
Definition: mf_tempdir.cc:57
bool my_gethwaddr(uchar *to)
Definition: my_gethwaddr.cc:237
uint get_collation_number(const char *name)
Definition: charset.cc:211
int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
Definition: mf_iocache.cc:1424
int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
Definition: mf_iocache.cc:1232
char * safe_strdup_root(MEM_ROOT *root, const char *str)
Definition: my_alloc.cc:283
int my_realpath(char *to, const char *filename, myf MyFlags)
Definition: my_symlink.cc:139
bool my_disable_locking
Definition: my_static.cc:224
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:410
bool real_open_cached_file(IO_CACHE *cache)
Definition: mf_cache.cc:75
int(* is_killed_hook)(const void *opaque_thd)
Definition: my_static.cc:213
int my_syslog(const CHARSET_INFO *cs, enum loglevel level, const char *msg)
Sends message to the system logger.
Definition: my_syslog.cc:94
void set_psi_thread_service(void *psi)
Definition: psi_noop.cc:253
MYSQL_PLUGIN_IMPORT PSI_socket_bootstrap * psi_socket_hook
Definition: psi_noop.cc:466
void my_end(int infoflag)
Definition: my_init.cc:176
bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size)
Definition: my_string.cc:82
char * home_dir
Definition: my_static.cc:80
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:321
ALWAYS_INLINE const char * base_name(const char *A)
Definition: my_sys.h:744
void my_message_stderr(uint my_err, const char *str, myf MyFlags)
Print an error message on stderr.
Definition: my_mess.cc:58
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:561
bool my_chmod(const char *filename, ulong perm_flags, myf my_flags)
Definition: my_chmod.cc:89
int my_mkdir(const char *dir, int Flags, myf MyFlags)
Definition: my_mkdir.cc:45
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:139
void set_psi_stage_service(void *psi)
Definition: psi_noop.cc:607
void set_psi_metric_service(void *psi)
Definition: psi_noop.cc:941
MYSQL_PLUGIN_IMPORT PSI_system_bootstrap * psi_system_hook
Definition: psi_noop.cc:897
MYSQL_PLUGIN_IMPORT PSI_mdl_bootstrap * psi_mdl_hook
Definition: psi_noop.cc:562
bool open_cached_file(IO_CACHE *cache, const char *dir, const char *prefix, size_t cache_size, myf cache_myflags)
Definition: mf_cache.cc:53
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:772
void set_psi_transaction_service(void *psi)
Definition: psi_noop.cc:823
void my_once_free(void)
Definition: my_once.cc:119
size_t my_b_fill(IO_CACHE *info)
Definition: mf_iocache2.cc:149
const char * charsets_dir
Definition: charset.cc:139
char * my_path(char *to, const char *progname, const char *own_pathname_part)
Definition: mf_path.cc:64
MYSQL_PLUGIN_IMPORT PSI_mutex_bootstrap * psi_mutex_hook
Definition: psi_noop.cc:281
void(* my_error_reporter)(enum loglevel level, uint ecode,...)
Definition: my_sys.h:510
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:64
void wait_for_free_space(const char *filename, int errors)
Definition: errors.cc:157
void thr_set_sync_wait_callback(void(*before_sync)(void), void(*after_sync)(void))
int my_readlink(char *to, const char *filename, myf MyFlags)
Definition: my_symlink.cc:67
static int my_getpagesize()
Definition: my_sys.h:889
char * fn_ext(char *name)
Definition: mf_fn_ext.cc:71
ALWAYS_INLINE const char * resolve_stack_pointer(const void *local_marker)
Resolve a stack address suitable for stack-usage accounting.
Definition: my_sys.h:102
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:207
flush_type
Definition: my_sys.h:330
@ SEQ_READ_APPEND
Definition: my_sys.h:324
@ TYPE_NOT_SET
Definition: my_sys.h:321
@ READ_NET
Definition: my_sys.h:326
@ WRITE_CACHE
Definition: my_sys.h:323
@ WRITE_NET
Definition: my_sys.h:327
@ READ_CACHE
Definition: my_sys.h:322
@ READ_FIFO
Definition: my_sys.h:325
@ UNLINK_FILE
Definition: my_sys.h:814
@ KEEP_FILE
Definition: my_sys.h:814
@ FLUSH_KEEP
Definition: my_sys.h:331
@ FLUSH_RELEASE
Definition: my_sys.h:332
@ FLUSH_FORCE_WRITE
Definition: my_sys.h:338
@ FLUSH_IGNORE_CHANGED
Definition: my_sys.h:333
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:48
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
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:10386
Functions to compare server version strings and version metadata to determine if Clone should be allo...
Header for compiler-dependent features.
#define ALWAYS_INLINE
Definition: my_compiler.h:99
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
Types to make file and socket I/O compatible.
mode_t MY_MODE
Definition: my_io_bits.h:59
int File
Definition: my_io_bits.h:51
Definition of the global "loglevel" enumeration.
loglevel
Definition: my_loglevel.h:41
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:71
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:1657
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:1642
bool binlog_cache_temporary_file_is_encrypted
(end of group MYSYS)
Definition: mf_iocache.cc:87
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:1649
void my_osmaperr(unsigned long oserrno)
Definition: my_winerr.cc:124
HANDLE my_get_osfhandle(File fd)
Return the Windows HANDLE for a file descriptor obtained from RegisterHandle().
Definition: my_winfile.cc:410
static int count
Definition: myisam_ftdump.cc:45
static const CHARSET_INFO * charset_info
Definition: mysql.cc:249
Instrumentation helpers for conditions.
ABI for instrumented mutexes.
void error(const char *format,...)
static char * path
Definition: mysqldump.cc:153
char * collation_name
Definition: audit_api_message_emit.cc:185
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1077
std::string format(const routing_guidelines::Session_info &session_info, bool extended_session_info)
Definition: dest_metadata_cache.cc:170
Definition: buf0block_hint.cc:30
const std::string FILE("FILE")
Definition: applier_version.h:27
std::string dir
Double write files location.
Definition: buf0dblwr.cc:81
Definition: os0file.h:89
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:76
std::span< uint8_t > Buffer
Definition: log0common.h:123
size_t size(const char *const c)
Definition: base64.h:46
int last_error()
get last socket error.
Definition: socket_error.h:82
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
std::string tmpdir()
Definition: utils_path_unix.cc:194
mode
Definition: file_handle.h:61
const char * filename
Definition: pfs_example_component_population.cc:67
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:60
required string type
Definition: replication_group_member_actions.proto:34
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
Definition: my_sys.h:347
char * str
Definition: my_sys.h:348
size_t length
Definition: my_sys.h:349
size_t max_length
Definition: my_sys.h:349
Definition: my_sys.h:355
int running_threads
Definition: my_sys.h:365
int error
Definition: my_sys.h:367
mysql_mutex_t mutex
Definition: my_sys.h:356
uchar * read_end
Definition: my_sys.h:364
my_off_t pos_in_file
Definition: my_sys.h:360
int total_threads
Definition: my_sys.h:366
mysql_cond_t cond_writer
Definition: my_sys.h:358
mysql_cond_t cond
Definition: my_sys.h:357
IO_CACHE * source_cache
Definition: my_sys.h:362
uchar * buffer
Definition: my_sys.h:363
Definition: my_sys.h:372
uchar * write_buffer
Definition: my_sys.h:390
uchar * read_pos
Definition: my_sys.h:382
my_off_t pos_in_file
Definition: my_sys.h:374
my_off_t end_of_file
Definition: my_sys.h:380
uchar * read_end
Definition: my_sys.h:384
uchar ** current_end
Definition: my_sys.h:409
ulong disk_writes
Definition: my_sys.h:460
IO_CACHE_CALLBACK post_read
Definition: my_sys.h:453
myf myflags
Definition: my_sys.h:480
void * arg
Definition: my_sys.h:461
uchar * buffer
Definition: my_sys.h:385
bool seek_not_done
Definition: my_sys.h:474
uchar * write_pos
Definition: my_sys.h:399
uchar ** current_pos
Definition: my_sys.h:409
PSI_file_key file_key
Definition: my_sys.h:465
int(* write_function)(IO_CACHE *, const uchar *, size_t)
Definition: my_sys.h:438
char * file_name
Definition: my_sys.h:462
uchar * append_read_pos
Definition: my_sys.h:397
uint disk_sync_delay
Definition: my_sys.h:496
uchar * request_pos
Definition: my_sys.h:387
size_t buffer_length
Definition: my_sys.h:477
int(* read_function)(IO_CACHE *, uchar *, size_t)
Definition: my_sys.h:433
char * dir
Definition: my_sys.h:463
bool alloced_buffer
Definition: my_sys.h:487
uchar * write_end
Definition: my_sys.h:401
Stream_cipher * m_encryptor
Definition: my_sys.h:489
char * prefix
Definition: my_sys.h:463
Stream_cipher * m_decryptor
Definition: my_sys.h:491
IO_CACHE_CALLBACK pre_close
Definition: my_sys.h:454
int error
Definition: my_sys.h:475
IO_CACHE_SHARE * share
Definition: my_sys.h:423
cache_type type
Definition: my_sys.h:444
size_t read_length
Definition: my_sys.h:479
IO_CACHE_CALLBACK pre_read
Definition: my_sys.h:452
mysql_mutex_t append_buffer_lock
Definition: my_sys.h:415
bool disk_sync
Definition: my_sys.h:493
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Helper structure to return error messages from collation parser/initializer.
Definition: m_ctype.h:180
Definition: my_sys.h:341
char ** list
Definition: my_sys.h:342
uint max
Definition: my_sys.h:343
uint cur
Definition: my_sys.h:343
mysql_mutex_t mutex
Definition: my_sys.h:344
Entry point for the performance schema interface.
Definition: psi_cond.h:46
Entry point for the performance schema interface.
Definition: psi_data_lock.h:82
Entry point for the performance schema interface.
Definition: psi_error.h:59
Entry point for the performance schema interface.
Definition: psi_file.h:66
Entry point for the performance schema interface.
Definition: psi_idle.h:60
Entry point for the performance schema interface.
Definition: psi_logger_client.h:46
Entry point for the performance schema interface.
Definition: psi_mdl.h:76
Entry point for the performance schema interface.
Definition: psi_memory.h:85
Entry point for the performance schema interface.
Definition: psi_metric.h:46
Entry point for the performance schema interface.
Definition: psi_mutex.h:46
Entry point for the performance schema interface.
Definition: psi_rwlock.h:53
Entry point for the performance schema interface.
Definition: psi_socket.h:52
Entry point for the performance schema interface.
Definition: psi_stage.h:46
Stage instrument information.
Definition: psi_stage_bits.h:74
Entry point for the performance schema interface.
Definition: psi_statement.h:46
Entry point for the performance schema interface.
Definition: psi_system.h:60
Entry point for the performance schema interface.
Definition: psi_table.h:60
Entry point for the performance schema interface.
Definition: psi_thread.h:102
Entry point for the performance schema interface.
Definition: psi_tls_channel.h:46
Entry point for the performance schema interface.
Definition: psi_transaction.h:60
Definition: my_sys.h:505
dev_t st_dev
Definition: my_sys.h:506
ino_t st_ino
Definition: my_sys.h:507
struct for once_alloc (block)
Definition: my_sys.h:590
unsigned int size
size of block
Definition: my_sys.h:593
unsigned int left
memory left in block
Definition: my_sys.h:592
USED_MEM * next
Next block in use.
Definition: my_sys.h:591
Compression context information.
Definition: my_compress.h:74
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:44
#define HANDLE
Definition: violite.h:159
int n
Definition: xcom_base.cc:509
static uint64_t cache_size
Definition: xcom_cache.cc:363