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