Coverage Report

Created: 2025-06-13 07:09

/src/server/include/my_sys.h
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
2
   Copyright (c) 2010, 2022, MariaDB Corporation.
3
4
   This program is free software; you can redistribute it and/or modify
5
   it under the terms of the GNU General Public License as published by
6
   the Free Software Foundation; version 2 of the License.
7
8
   This program is distributed in the hope that it will be useful,
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
   GNU General Public License for more details.
12
13
   You should have received a copy of the GNU General Public License
14
   along with this program; if not, write to the Free Software
15
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1335  USA */
16
17
#ifndef _my_sys_h
18
#define _my_sys_h
19
20
#include <m_string.h>
21
#include <mysql/psi/mysql_memory.h>
22
23
C_MODE_START
24
25
26
#include <my_valgrind.h>
27
#include <my_pthread.h>
28
#include <m_ctype.h>                    /* for CHARSET_INFO */
29
#include <stdarg.h>
30
#include <typelib.h>
31
#include <my_alloca.h>
32
#include <my_cmp.h>
33
#include <mysql/plugin.h>
34
#include <mysql/service_my_print_error.h>
35
36
#define MY_INIT(name)   { my_progname= name; my_init(); }
37
38
/**
39
  Max length of an error message generated by mysys utilities.
40
  Some mysys functions produce error messages. These mostly go
41
  to stderr.
42
  This constant defines the size of the buffer used to format
43
  the message. It should be kept in sync with MYSQL_ERRMSG_SIZE,
44
  since sometimes mysys errors are stored in the server diagnostics
45
  area, and we would like to avoid unexpected truncation.
46
*/
47
#define MYSYS_ERRMSG_SIZE   (512)
48
#define MYSYS_STRERROR_SIZE (256)
49
50
0
#define MY_FILE_ERROR ((size_t) -1)
51
52
  /* General bitmaps for my_func's */
53
0
#define MY_FFNF   1U  /* Fatal if file not found */
54
0
#define MY_FNABP  2U  /* Fatal if not all bytes read/written */
55
0
#define MY_NABP   4U  /* Error if not all bytes read/written */
56
0
#define MY_FAE    8U  /* Fatal if any error */
57
0
#define MY_WME    16U  /* Write message on error */
58
#define MY_WAIT_IF_FULL 32U /* Wait and try again if disk full error */
59
0
#define MY_IGNORE_BADFD 32U     /* my_sync(): ignore 'bad descriptor' errors */
60
#define MY_IGNORE_ENOENT 32U    /* my_delete() ignores ENOENT (no such file) */
61
#define MY_ENCRYPT      64U     /* Encrypt IO_CACHE temporary files */
62
#define MY_TEMPORARY    64U     /* create_temp_file(): delete file at once */
63
0
#define MY_NOSYMLINKS  512U     /* my_open(): don't follow symlinks */
64
0
#define MY_FULL_IO     512U     /* my_read(): loop until I/O is complete */
65
#define MY_DONT_CHECK_FILESIZE 128U /* Option to init_io_cache() */
66
#define MY_LINK_WARNING 32U /* my_redel() gives warning if links */
67
#define MY_COPYTIME 64U /* my_redel() copies time */
68
#define MY_DELETE_OLD 256U  /* my_create_with_symlink() */
69
#define MY_RESOLVE_LINK 128U  /* my_realpath(); Only resolve links */
70
#define MY_HOLD_ORIGINAL_MODES 128U  /* my_copy() holds to file modes */
71
#define MY_REDEL_MAKE_BACKUP 256U
72
#define MY_SEEK_NOT_DONE 32U  /* my_lock may have to do a seek */
73
#define MY_SHORT_WAIT 64U /* my_lock() don't wait if can't lock */
74
#define MY_FORCE_LOCK   128U    /* use my_lock() even if disable_locking */
75
#define MY_NO_WAIT      256U  /* my_lock() don't wait at all */
76
0
#define MY_NO_REGISTER  8196U   /* my_open(), no malloc for file name */
77
/*
78
  If old_mode is UTF8_IS_UTF8MB3, then pass this flag. It mean utf8 is
79
  alias for utf8mb3. Otherwise utf8 is alias for utf8mb4.
80
*/
81
0
#define MY_UTF8_IS_UTF8MB3 1024U
82
/*
83
  init_dynamic_array() has init buffer; Internal flag, not to be used by
84
  caller.
85
*/
86
0
#define MY_INIT_BUFFER_USED 256U
87
0
#define MY_ZEROFILL 32U  /* my_malloc(), fill array with zero */
88
0
#define MY_ALLOW_ZERO_PTR 64U  /* my_realloc() ; zero ptr -> malloc */
89
0
#define MY_FREE_ON_ERROR 128U  /* my_realloc() ; Free old ptr on error */
90
#define MY_DONT_OVERWRITE_FILE 2048U /* my_copy: Don't overwrite file */
91
#define MY_THREADSAFE 2048U     /* my_seek(): lock fd mutex */
92
#define MY_SYNC       4096U     /* my_copy(): sync dst file */
93
0
#define MY_SYNC_DIR   32768U    /* my_create/delete/rename: sync directory */
94
0
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
95
0
#define MY_ROOT_USE_MPROTECT 0x20000U /* init_alloc_root: read only segments */
96
/* Tree that should delete things automatically */
97
#define MY_TREE_WITH_DELETE 0x40000U
98
#define MY_TRACK 0x80000U             /* Track tmp usage */
99
#define MY_TRACK_WITH_LIMIT 0x100000U /* Give error if over tmp_file_usage */
100
101
0
#define MY_CHECK_ERROR  1U  /* Params to my_end; Check open-close */
102
0
#define MY_GIVE_INFO  2U  /* Give time info about process*/
103
0
#define MY_DONT_FREE_DBUG 4U    /* Do not call DBUG_END() in my_end() */
104
105
0
#define ME_BELL           4U    /* Ring bell then printing message */
106
#define ME_ERROR_LOG      64    /**< write the error message to error log */
107
0
#define ME_ERROR_LOG_ONLY 128   /**< write the error message to error log only */
108
0
#define ME_NOTE           1024  /**< not error but just info */
109
#define ME_WARNING        2048  /**< not error but just warning */
110
#define ME_FATAL          4096  /**< fatal statement error */
111
112
  /* Bits in last argument to fn_format */
113
#define MY_REPLACE_DIR    1U  /* replace dir in name with 'dir' */
114
#define MY_REPLACE_EXT    2U  /* replace extension with 'ext' */
115
#define MY_UNPACK_FILENAME  4U  /* Unpack name (~ -> home) */
116
#define MY_PACK_FILENAME  8U  /* Pack name (home -> ~) */
117
#define MY_RESOLVE_SYMLINKS 16U /* Resolve all symbolic links */
118
#define MY_RETURN_REAL_PATH 32U /* return full path for file */
119
#define MY_SAFE_PATH    64U /* Return NULL if too long path */
120
#define MY_RELATIVE_PATH  128U  /* name is relative to 'dir' */
121
#define MY_APPEND_EXT           256U    /* add 'ext' as additional extension*/
122
123
124
  /* My seek flags */
125
#define MY_SEEK_SET 0
126
#define MY_SEEK_CUR 1
127
#define MY_SEEK_END 2
128
129
  /* Some constants */
130
0
#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60  /* in seconds */
131
0
#define MY_WAIT_GIVE_USER_A_MESSAGE 10  /* Every 10 times of prev */
132
#define MIN_COMPRESS_LENGTH   50  /* Don't compress small bl. */
133
#define DFLT_INIT_HITS  3
134
135
  /* root_alloc flags */
136
0
#define MY_KEEP_PREALLOC  1U
137
0
#define MY_MARK_BLOCKS_FREE     2U /* move used to free list and reuse them */
138
139
  /* Internal error numbers (for assembler functions) */
140
0
#define MY_ERRNO_EDOM   33
141
0
#define MY_ERRNO_ERANGE   34
142
143
  /* Bits for get_date timeflag */
144
#define GETDATE_DATE_TIME 1U
145
#define GETDATE_SHORT_DATE  2U
146
#define GETDATE_HHMMSSTIME  4U
147
#define GETDATE_GMT   8U
148
#define GETDATE_FIXEDLENGTH 16U
149
150
/* Extra length needed for filename if one calls my_create_backup_name */
151
#define MY_BACKUP_NAME_EXTRA_LENGTH 17
152
153
char *guess_malloc_library();
154
155
/* If we have our own safemalloc (for debugging) */
156
#if defined(SAFEMALLOC)
157
void sf_report_leaked_memory(my_thread_id id);
158
int sf_sanity();
159
extern my_thread_id (*sf_malloc_dbug_id)(void);
160
#define SAFEMALLOC_REPORT_MEMORY(X) if (!sf_leaking_memory) sf_report_leaked_memory(X)
161
#else
162
#define SAFEMALLOC_REPORT_MEMORY(X) do {} while(0)
163
#endif
164
165
typedef void (*MALLOC_SIZE_CB) (long long size, my_bool is_thread_specific); 
166
extern void set_malloc_size_cb(MALLOC_SIZE_CB func);
167
extern MALLOC_SIZE_CB update_malloc_size;
168
extern int64 my_malloc_init_memory_allocated;
169
170
  /* defines when allocating data */
171
extern void *my_malloc(PSI_memory_key key, size_t size, myf MyFlags);
172
extern void *my_multi_malloc(PSI_memory_key key, myf MyFlags, ...);
173
extern void *my_multi_malloc_large(PSI_memory_key key, myf MyFlags, ...);
174
extern void *my_realloc(PSI_memory_key key, void *ptr, size_t size, myf MyFlags);
175
extern void my_free(void *ptr);
176
extern void *my_memdup(PSI_memory_key key, const void *from,size_t length,myf MyFlags);
177
extern char *my_strdup(PSI_memory_key key, const char *from,myf MyFlags);
178
extern char *my_strndup(PSI_memory_key key, const char *from, size_t length, myf MyFlags);
179
extern my_bool my_use_large_pages;
180
181
int my_init_large_pages(void);
182
uchar *my_large_malloc(size_t *size, myf my_flags);
183
#ifdef _WIN32
184
/* On Windows, use my_virtual_mem_reserve() and my_virtual_mem_commit(). */
185
#else
186
char *my_large_virtual_alloc(size_t *size);
187
#endif
188
void my_large_free(void *ptr, size_t size);
189
void my_large_page_truncate(size_t *size);
190
191
/* Tracking tmp file usage */
192
193
struct tmp_file_tracking
194
{
195
  ulonglong previous_file_size;
196
  ulonglong file_size;
197
};
198
199
typedef int (*TMPFILE_SIZE_CB)(struct tmp_file_tracking *track, int no_error);
200
extern TMPFILE_SIZE_CB update_tmp_file_size;
201
202
#ifdef _WIN32
203
extern BOOL my_obtain_privilege(LPCSTR lpPrivilege);
204
#endif
205
206
void my_init_atomic_write(void);
207
#ifdef __linux__
208
my_bool my_test_if_atomic_write(File handle, int pagesize);
209
my_bool my_test_if_thinly_provisioned(File handle);
210
#else
211
# define my_test_if_atomic_write(A, B)      0
212
# define my_test_if_thinly_provisioned(A)   0
213
#endif /* __linux__ */
214
extern my_bool my_may_have_atomic_write;
215
216
#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
217
0
#define my_alloca(SZ) alloca((size_t) (SZ))
218
0
#define my_afree(PTR) ((void)0)
219
#define MAX_ALLOCA_SZ 4096
220
#define my_safe_alloca(size) (((size) <= MAX_ALLOCA_SZ) ? \
221
                               my_alloca(size) : \
222
                               my_malloc(PSI_NOT_INSTRUMENTED, (size), MYF(MY_THREAD_SPECIFIC|MY_WME)))
223
#define my_safe_afree(ptr, size) \
224
                  do { if ((size) > MAX_ALLOCA_SZ) my_free(ptr); } while(0)
225
#else
226
#define my_alloca(SZ) my_malloc(PSI_NOT_INSTRUMENTED, SZ,MYF(MY_FAE))
227
#define my_afree(PTR) my_free(PTR)
228
#define my_safe_alloca(size) my_alloca(size)
229
#define my_safe_afree(ptr, size) my_afree(ptr)
230
#endif /* HAVE_ALLOCA */
231
232
#ifndef errno       /* did we already get it? */
233
#ifdef HAVE_ERRNO_AS_DEFINE
234
#include <errno.h>      /* errno is a define */
235
#else
236
extern int errno;     /* declare errno */
237
#endif
238
#endif          /* #ifndef errno */
239
extern char *home_dir;      /* Home directory for user */
240
extern MYSQL_PLUGIN_IMPORT char  *mysql_data_home;
241
extern const char *my_progname;   /* program-name (printed in errors) */
242
extern const char *my_progname_short; /* like above but without directory */
243
extern char curr_dir[];   /* Current directory for user */
244
extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
245
extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
246
               myf MyFlags);
247
extern uint my_file_limit;
248
extern ulonglong my_thread_stack_size;
249
extern int sf_leaking_memory; /* set to 1 to disable memleak detection */
250
251
extern void (*proc_info_hook)(void *, const PSI_stage_info *, PSI_stage_info *,
252
                              const char *, const char *, const unsigned int);
253
254
/* charsets */
255
#define MY_ALL_CHARSETS_SIZE 4096
256
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
257
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
258
extern struct charset_info_st compiled_charsets[];
259
260
/* Collation properties and use statistics */
261
extern my_bool my_collation_is_known_id(uint id);
262
extern ulonglong my_collation_statistics_get_use_count(uint id);
263
extern const char *my_collation_get_tailoring(uint id);
264
265
/* statistics */
266
extern ulong    my_stream_opened, my_tmp_file_created;
267
extern ulong    my_file_total_opened;
268
extern ulong    my_sync_count;
269
extern uint mysys_usage_id;
270
extern int32    my_file_opened;
271
extern my_bool  my_init_done;
272
extern my_bool my_assert;
273
extern my_bool  my_assert_on_error;
274
extern myf      my_global_flags;        /* Set to MY_WME for more error messages */
275
          /* Point to current my_message() */
276
extern void (*my_sigtstp_cleanup)(void),
277
          /* Executed before jump to shell */
278
      (*my_sigtstp_restart)(void);
279
          /* Executed when coming from shell */
280
extern MYSQL_PLUGIN_IMPORT mode_t my_umask; /* Default creation mask  */
281
extern mode_t my_umask_dir;
282
extern int my_recived_signals,  /* Signals we have got */
283
     my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
284
     my_dont_interrupt; /* call remember_intr when set */
285
#ifdef _WIN32
286
extern SECURITY_ATTRIBUTES my_dir_security_attributes;
287
LPSECURITY_ATTRIBUTES my_win_file_secattr();
288
#endif
289
extern MYSQL_PLUGIN_IMPORT my_bool my_use_symdir;
290
291
extern ulong  my_default_record_cache_size;
292
extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking;
293
extern my_bool  my_disable_async_io,
294
                my_disable_flush_key_blocks, my_disable_symlinks;
295
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
296
extern char wild_many,wild_one,wild_prefix;
297
extern const char *charsets_dir;
298
extern size_t my_system_page_size;
299
300
enum cache_type
301
{
302
  TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
303
  SEQ_READ_APPEND   /* sequential read or append */,
304
  READ_FIFO, READ_NET};
305
306
enum flush_type
307
{
308
  FLUSH_KEEP,           /* flush block and keep it in the cache */
309
  FLUSH_RELEASE,        /* flush block and remove it from the cache */
310
  FLUSH_IGNORE_CHANGED, /* remove block from the cache */
311
  /*
312
    As my_disable_flush_pagecache_blocks is always 0, the following option
313
    is strictly equivalent to FLUSH_KEEP
314
  */
315
  FLUSH_FORCE_WRITE,
316
  /**
317
     @brief like FLUSH_KEEP but return immediately if file is already being
318
     flushed (even partially) by another thread; only for page cache,
319
     forbidden for key cache.
320
  */
321
  FLUSH_KEEP_LAZY
322
};
323
324
typedef struct st_record_cache  /* Used when caching records */
325
{
326
  File file;
327
  int rc_seek,error,inited;
328
  uint  rc_length,read_length,reclength;
329
  my_off_t rc_record_pos,end_of_file;
330
  uchar *rc_buff,*rc_buff2,*rc_pos,*rc_end,*rc_request_pos;
331
  enum cache_type type;
332
} RECORD_CACHE;
333
334
enum file_type
335
{
336
  UNOPEN = 0, FILE_BY_OPEN, FILE_BY_CREATE, STREAM_BY_FOPEN, STREAM_BY_FDOPEN,
337
  FILE_BY_O_TMPFILE, FILE_BY_MKSTEMP, FILE_BY_DUP
338
};
339
340
struct st_my_file_info
341
{
342
  char  *name;
343
#ifdef _WIN32
344
  HANDLE fhandle;   /* win32 file handle */
345
  int    oflag;     /* open flags, e.g O_APPEND */
346
#endif
347
  enum   file_type  type;
348
};
349
350
extern struct st_my_file_info *my_file_info;
351
352
/* Free function pointer */
353
typedef void (*FREE_FUNC)(void *);
354
355
typedef struct st_dynamic_array
356
{
357
  uchar *buffer;
358
  size_t elements, max_element;
359
  size_t alloc_increment;
360
  size_t size_of_element;
361
  PSI_memory_key m_psi_key;
362
  myf malloc_flags;
363
} DYNAMIC_ARRAY;
364
365
366
typedef struct st_dynamic_array_append
367
{
368
  DYNAMIC_ARRAY *array;
369
  uchar *pos, *end;
370
} DYNAMIC_ARRAY_APPEND;
371
372
373
typedef struct st_my_tmpdir
374
{
375
  DYNAMIC_ARRAY full_list;
376
  char **list;
377
  size_t cur, max;
378
  mysql_mutex_t mutex;
379
} MY_TMPDIR;
380
381
typedef struct st_dynamic_string
382
{
383
  char *str;
384
  size_t length,max_length,alloc_increment;
385
} DYNAMIC_STRING;
386
387
struct st_io_cache;
388
389
typedef struct st_io_cache_share
390
{
391
  mysql_mutex_t       mutex;           /* To sync on reads into buffer. */
392
  mysql_cond_t        cond;            /* To wait for signals. */
393
  mysql_cond_t        cond_writer;     /* For a synchronized writer. */
394
  /* Offset in file corresponding to the first byte of buffer. */
395
  my_off_t              pos_in_file;
396
  /* If a synchronized write cache is the source of the data. */
397
  struct st_io_cache    *source_cache;
398
  uchar                 *buffer;         /* The read buffer. */
399
  uchar                 *read_end;       /* Behind last valid byte of buffer. */
400
  int                   running_threads; /* threads not in lock. */
401
  int                   total_threads;   /* threads sharing the cache. */
402
  int                   error;           /* Last error. */
403
#ifdef NOT_YET_IMPLEMENTED
404
  /* whether the structure should be free'd */
405
  my_bool alloced;
406
#endif
407
} IO_CACHE_SHARE;
408
409
typedef struct st_io_cache    /* Used when caching files */
410
{
411
  /* Offset in file corresponding to the first byte of uchar* buffer. */
412
  my_off_t pos_in_file;
413
  /*
414
    The offset of end of file for READ_CACHE and WRITE_CACHE.
415
    For SEQ_READ_APPEND it the maximum of the actual end of file and
416
    the position represented by read_end.
417
  */
418
  my_off_t end_of_file;
419
  /* Points to current read position in the buffer */
420
  uchar *read_pos;
421
  /* the non-inclusive boundary in the buffer for the currently valid read */
422
  uchar  *read_end;
423
  uchar  *buffer;       /* The read buffer */
424
  /* Used in ASYNC_IO */
425
  uchar  *request_pos;
426
427
  /* Only used in WRITE caches and in SEQ_READ_APPEND to buffer writes */
428
  uchar  *write_buffer;
429
  /*
430
    Only used in SEQ_READ_APPEND, and points to the current read position
431
    in the write buffer. Note that reads in SEQ_READ_APPEND caches can
432
    happen from both read buffer (uchar* buffer) and write buffer
433
    (uchar* write_buffer).
434
  */
435
  uchar *append_read_pos;
436
  /* Points to current write position in the write buffer */
437
  uchar *write_pos;
438
  /* The non-inclusive boundary of the valid write area */
439
  uchar *write_end;
440
441
  /*
442
    The lock is for append buffer used in SEQ_READ_APPEND cache
443
    need mutex copying from append buffer to read buffer.
444
  */
445
  mysql_mutex_t append_buffer_lock;
446
  /*
447
    The following is used when several threads are reading the
448
    same file in parallel. They are synchronized on disk
449
    accesses reading the cached part of the file asynchronously.
450
    It should be set to NULL to disable the feature.  Only
451
    READ_CACHE mode is supported.
452
  */
453
  IO_CACHE_SHARE *share;
454
455
  /* Track tmpfile usage. Done if (myflags & MY_TRACK) is true */
456
  struct tmp_file_tracking tracking;
457
  /*
458
    A caller will use my_b_read() macro to read from the cache
459
    if the data is already in cache, it will be simply copied with
460
    memcpy() and internal variables will be accordingly updated with
461
    no functions invoked. However, if the data is not fully in the cache,
462
    my_b_read() will call read_function to fetch the data. read_function
463
    must never be invoked directly.
464
  */
465
  int (*read_function)(struct st_io_cache *,uchar *,size_t);
466
  /*
467
    Same idea as in the case of read_function, except my_b_write() needs to
468
    be replaced with my_b_append() for a SEQ_READ_APPEND cache
469
  */
470
  int (*write_function)(struct st_io_cache *,const uchar *,size_t);
471
  /*
472
    Specifies the type of the cache. Depending on the type of the cache
473
    certain operations might not be available and yield unpredictable
474
    results. Details to be documented later
475
  */
476
  enum cache_type type;
477
  /*
478
    Counts the number of times, when we were forced to use disk. We use it to
479
    increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status
480
    variables.
481
  */
482
  ulong disk_writes;
483
  char *file_name;      /* if used with 'open_cached_file' */
484
  const char *dir;
485
  char prefix[3];
486
  File file; /* file descriptor */
487
488
  struct st_io_cache *next_file_user;
489
  /*
490
    seek_not_done is set by my_b_seek() to inform the upcoming read/write
491
    operation that a seek needs to be preformed prior to the actual I/O
492
    error is 0 if the cache operation was successful, -1 if there was a
493
    "hard" error, and the actual number of I/O-ed bytes if the read/write was
494
    partial.
495
  */
496
  int seek_not_done,error;
497
  /* length of the buffer used for storing un-encrypted data */
498
  size_t  buffer_length;
499
  /* read_length is the same as buffer_length except when we use async io */
500
  size_t  read_length;
501
  myf myflags;      /* Flags used to my_read/my_write */
502
  /*
503
    alloced_buffer is set to the size of the buffer allocated for the IO_CACHE.
504
    Includes the overhead(storing key to encrypt and decrypt) for encryption.
505
    Set to 0 if nothing is allocated.
506
    Currently READ_NET is the only one that will use a buffer allocated
507
    somewhere else
508
  */
509
  size_t alloced_buffer;
510
} IO_CACHE;
511
512
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...)
513
  ATTRIBUTE_FORMAT_FPTR(printf, 2, 3);
514
515
extern my_error_reporter my_charset_error_reporter;
516
517
extern PSI_file_key key_file_io_cache;
518
519
/* inline functions for mf_iocache */
520
521
extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
522
extern void truncate_io_cache(IO_CACHE *info);
523
extern int _my_b_get(IO_CACHE *info);
524
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
525
extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
526
527
/* Test if buffer is inited */
528
0
static inline void my_b_clear(IO_CACHE *info) { info->buffer= 0; }
Unexecuted instantiation: fuzz_json.c:my_b_clear
Unexecuted instantiation: json_lib.c:my_b_clear
Unexecuted instantiation: ctype-ucs2.c:my_b_clear
Unexecuted instantiation: dtoa.c:my_b_clear
Unexecuted instantiation: xml.c:my_b_clear
Unexecuted instantiation: ctype-simple.c:my_b_clear
Unexecuted instantiation: my_strtoll10.c:my_b_clear
Unexecuted instantiation: my_vsnprintf.c:my_b_clear
Unexecuted instantiation: my_malloc.c:my_b_clear
Unexecuted instantiation: my_static.c:my_b_clear
Unexecuted instantiation: my_thr_init.c:my_b_clear
Unexecuted instantiation: thr_mutex.c:my_b_clear
Unexecuted instantiation: thr_rwlock.c:my_b_clear
Unexecuted instantiation: psi_noop.c:my_b_clear
Unexecuted instantiation: my_error.c:my_b_clear
Unexecuted instantiation: my_getsystime.c:my_b_clear
Unexecuted instantiation: my_init.c:my_b_clear
Unexecuted instantiation: my_mess.c:my_b_clear
Unexecuted instantiation: my_once.c:my_b_clear
Unexecuted instantiation: my_symlink.c:my_b_clear
Unexecuted instantiation: my_sync.c:my_b_clear
Unexecuted instantiation: my_getpagesize.c:my_b_clear
Unexecuted instantiation: charset.c:my_b_clear
Unexecuted instantiation: errors.c:my_b_clear
Unexecuted instantiation: hash.c:my_b_clear
Unexecuted instantiation: mf_dirname.c:my_b_clear
Unexecuted instantiation: mf_loadpath.c:my_b_clear
Unexecuted instantiation: mf_pack.c:my_b_clear
Unexecuted instantiation: my_div.c:my_b_clear
Unexecuted instantiation: my_getwd.c:my_b_clear
Unexecuted instantiation: my_lib.c:my_b_clear
Unexecuted instantiation: my_open.c:my_b_clear
Unexecuted instantiation: my_read.c:my_b_clear
Unexecuted instantiation: array.c:my_b_clear
Unexecuted instantiation: charset-def.c:my_b_clear
Unexecuted instantiation: mf_qsort.c:my_b_clear
Unexecuted instantiation: my_alloc.c:my_b_clear
Unexecuted instantiation: ctype-tis620.c:my_b_clear
Unexecuted instantiation: str2int.c:my_b_clear
529
0
static inline int my_b_inited(IO_CACHE *info) { return MY_TEST(info->buffer); }
Unexecuted instantiation: fuzz_json.c:my_b_inited
Unexecuted instantiation: json_lib.c:my_b_inited
Unexecuted instantiation: ctype-ucs2.c:my_b_inited
Unexecuted instantiation: dtoa.c:my_b_inited
Unexecuted instantiation: xml.c:my_b_inited
Unexecuted instantiation: ctype-simple.c:my_b_inited
Unexecuted instantiation: my_strtoll10.c:my_b_inited
Unexecuted instantiation: my_vsnprintf.c:my_b_inited
Unexecuted instantiation: my_malloc.c:my_b_inited
Unexecuted instantiation: my_static.c:my_b_inited
Unexecuted instantiation: my_thr_init.c:my_b_inited
Unexecuted instantiation: thr_mutex.c:my_b_inited
Unexecuted instantiation: thr_rwlock.c:my_b_inited
Unexecuted instantiation: psi_noop.c:my_b_inited
Unexecuted instantiation: my_error.c:my_b_inited
Unexecuted instantiation: my_getsystime.c:my_b_inited
Unexecuted instantiation: my_init.c:my_b_inited
Unexecuted instantiation: my_mess.c:my_b_inited
Unexecuted instantiation: my_once.c:my_b_inited
Unexecuted instantiation: my_symlink.c:my_b_inited
Unexecuted instantiation: my_sync.c:my_b_inited
Unexecuted instantiation: my_getpagesize.c:my_b_inited
Unexecuted instantiation: charset.c:my_b_inited
Unexecuted instantiation: errors.c:my_b_inited
Unexecuted instantiation: hash.c:my_b_inited
Unexecuted instantiation: mf_dirname.c:my_b_inited
Unexecuted instantiation: mf_loadpath.c:my_b_inited
Unexecuted instantiation: mf_pack.c:my_b_inited
Unexecuted instantiation: my_div.c:my_b_inited
Unexecuted instantiation: my_getwd.c:my_b_inited
Unexecuted instantiation: my_lib.c:my_b_inited
Unexecuted instantiation: my_open.c:my_b_inited
Unexecuted instantiation: my_read.c:my_b_inited
Unexecuted instantiation: array.c:my_b_inited
Unexecuted instantiation: charset-def.c:my_b_inited
Unexecuted instantiation: mf_qsort.c:my_b_inited
Unexecuted instantiation: my_alloc.c:my_b_inited
Unexecuted instantiation: ctype-tis620.c:my_b_inited
Unexecuted instantiation: str2int.c:my_b_inited
530
#define my_b_EOF INT_MIN
531
532
static inline int my_b_read(IO_CACHE *info, uchar *Buffer, size_t Count)
533
0
{
534
0
  if (info->read_pos + Count <= info->read_end)
535
0
  {
536
0
    memcpy(Buffer, info->read_pos, Count);
537
0
    info->read_pos+= Count;
538
0
    return 0;
539
0
  }
540
0
  return _my_b_read(info, Buffer, Count);
541
0
}
Unexecuted instantiation: fuzz_json.c:my_b_read
Unexecuted instantiation: json_lib.c:my_b_read
Unexecuted instantiation: ctype-ucs2.c:my_b_read
Unexecuted instantiation: dtoa.c:my_b_read
Unexecuted instantiation: xml.c:my_b_read
Unexecuted instantiation: ctype-simple.c:my_b_read
Unexecuted instantiation: my_strtoll10.c:my_b_read
Unexecuted instantiation: my_vsnprintf.c:my_b_read
Unexecuted instantiation: my_malloc.c:my_b_read
Unexecuted instantiation: my_static.c:my_b_read
Unexecuted instantiation: my_thr_init.c:my_b_read
Unexecuted instantiation: thr_mutex.c:my_b_read
Unexecuted instantiation: thr_rwlock.c:my_b_read
Unexecuted instantiation: psi_noop.c:my_b_read
Unexecuted instantiation: my_error.c:my_b_read
Unexecuted instantiation: my_getsystime.c:my_b_read
Unexecuted instantiation: my_init.c:my_b_read
Unexecuted instantiation: my_mess.c:my_b_read
Unexecuted instantiation: my_once.c:my_b_read
Unexecuted instantiation: my_symlink.c:my_b_read
Unexecuted instantiation: my_sync.c:my_b_read
Unexecuted instantiation: my_getpagesize.c:my_b_read
Unexecuted instantiation: charset.c:my_b_read
Unexecuted instantiation: errors.c:my_b_read
Unexecuted instantiation: hash.c:my_b_read
Unexecuted instantiation: mf_dirname.c:my_b_read
Unexecuted instantiation: mf_loadpath.c:my_b_read
Unexecuted instantiation: mf_pack.c:my_b_read
Unexecuted instantiation: my_div.c:my_b_read
Unexecuted instantiation: my_getwd.c:my_b_read
Unexecuted instantiation: my_lib.c:my_b_read
Unexecuted instantiation: my_open.c:my_b_read
Unexecuted instantiation: my_read.c:my_b_read
Unexecuted instantiation: array.c:my_b_read
Unexecuted instantiation: charset-def.c:my_b_read
Unexecuted instantiation: mf_qsort.c:my_b_read
Unexecuted instantiation: my_alloc.c:my_b_read
Unexecuted instantiation: ctype-tis620.c:my_b_read
Unexecuted instantiation: str2int.c:my_b_read
542
543
static inline int my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
544
0
{
545
0
  MEM_CHECK_DEFINED(Buffer, Count);
546
0
  if (info->write_pos + Count <= info->write_end)
547
0
  {
548
0
    if (Count)
549
0
    {
550
0
      memcpy(info->write_pos, Buffer, Count);
551
0
      info->write_pos+= Count;
552
0
    }
553
0
    return 0;
554
0
  }
555
0
  return _my_b_write(info, Buffer, Count);
556
0
}
Unexecuted instantiation: fuzz_json.c:my_b_write
Unexecuted instantiation: json_lib.c:my_b_write
Unexecuted instantiation: ctype-ucs2.c:my_b_write
Unexecuted instantiation: dtoa.c:my_b_write
Unexecuted instantiation: xml.c:my_b_write
Unexecuted instantiation: ctype-simple.c:my_b_write
Unexecuted instantiation: my_strtoll10.c:my_b_write
Unexecuted instantiation: my_vsnprintf.c:my_b_write
Unexecuted instantiation: my_malloc.c:my_b_write
Unexecuted instantiation: my_static.c:my_b_write
Unexecuted instantiation: my_thr_init.c:my_b_write
Unexecuted instantiation: thr_mutex.c:my_b_write
Unexecuted instantiation: thr_rwlock.c:my_b_write
Unexecuted instantiation: psi_noop.c:my_b_write
Unexecuted instantiation: my_error.c:my_b_write
Unexecuted instantiation: my_getsystime.c:my_b_write
Unexecuted instantiation: my_init.c:my_b_write
Unexecuted instantiation: my_mess.c:my_b_write
Unexecuted instantiation: my_once.c:my_b_write
Unexecuted instantiation: my_symlink.c:my_b_write
Unexecuted instantiation: my_sync.c:my_b_write
Unexecuted instantiation: my_getpagesize.c:my_b_write
Unexecuted instantiation: charset.c:my_b_write
Unexecuted instantiation: errors.c:my_b_write
Unexecuted instantiation: hash.c:my_b_write
Unexecuted instantiation: mf_dirname.c:my_b_write
Unexecuted instantiation: mf_loadpath.c:my_b_write
Unexecuted instantiation: mf_pack.c:my_b_write
Unexecuted instantiation: my_div.c:my_b_write
Unexecuted instantiation: my_getwd.c:my_b_write
Unexecuted instantiation: my_lib.c:my_b_write
Unexecuted instantiation: my_open.c:my_b_write
Unexecuted instantiation: my_read.c:my_b_write
Unexecuted instantiation: array.c:my_b_write
Unexecuted instantiation: charset-def.c:my_b_write
Unexecuted instantiation: mf_qsort.c:my_b_write
Unexecuted instantiation: my_alloc.c:my_b_write
Unexecuted instantiation: ctype-tis620.c:my_b_write
Unexecuted instantiation: str2int.c:my_b_write
557
558
static inline int my_b_get(IO_CACHE *info)
559
0
{
560
0
  if (info->read_pos != info->read_end)
561
0
  {
562
0
    info->read_pos++;
563
0
    return info->read_pos[-1];
564
0
  }
565
0
  return _my_b_get(info);
566
0
}
Unexecuted instantiation: fuzz_json.c:my_b_get
Unexecuted instantiation: json_lib.c:my_b_get
Unexecuted instantiation: ctype-ucs2.c:my_b_get
Unexecuted instantiation: dtoa.c:my_b_get
Unexecuted instantiation: xml.c:my_b_get
Unexecuted instantiation: ctype-simple.c:my_b_get
Unexecuted instantiation: my_strtoll10.c:my_b_get
Unexecuted instantiation: my_vsnprintf.c:my_b_get
Unexecuted instantiation: my_malloc.c:my_b_get
Unexecuted instantiation: my_static.c:my_b_get
Unexecuted instantiation: my_thr_init.c:my_b_get
Unexecuted instantiation: thr_mutex.c:my_b_get
Unexecuted instantiation: thr_rwlock.c:my_b_get
Unexecuted instantiation: psi_noop.c:my_b_get
Unexecuted instantiation: my_error.c:my_b_get
Unexecuted instantiation: my_getsystime.c:my_b_get
Unexecuted instantiation: my_init.c:my_b_get
Unexecuted instantiation: my_mess.c:my_b_get
Unexecuted instantiation: my_once.c:my_b_get
Unexecuted instantiation: my_symlink.c:my_b_get
Unexecuted instantiation: my_sync.c:my_b_get
Unexecuted instantiation: my_getpagesize.c:my_b_get
Unexecuted instantiation: charset.c:my_b_get
Unexecuted instantiation: errors.c:my_b_get
Unexecuted instantiation: hash.c:my_b_get
Unexecuted instantiation: mf_dirname.c:my_b_get
Unexecuted instantiation: mf_loadpath.c:my_b_get
Unexecuted instantiation: mf_pack.c:my_b_get
Unexecuted instantiation: my_div.c:my_b_get
Unexecuted instantiation: my_getwd.c:my_b_get
Unexecuted instantiation: my_lib.c:my_b_get
Unexecuted instantiation: my_open.c:my_b_get
Unexecuted instantiation: my_read.c:my_b_get
Unexecuted instantiation: array.c:my_b_get
Unexecuted instantiation: charset-def.c:my_b_get
Unexecuted instantiation: mf_qsort.c:my_b_get
Unexecuted instantiation: my_alloc.c:my_b_get
Unexecuted instantiation: ctype-tis620.c:my_b_get
Unexecuted instantiation: str2int.c:my_b_get
567
568
static inline my_bool my_b_write_byte(IO_CACHE *info, uchar chr)
569
0
{
570
0
  MEM_CHECK_DEFINED(&chr, 1);
571
0
  if (info->write_pos >= info->write_end)
572
0
    if (my_b_flush_io_cache(info, 1))
573
0
      return 1;
574
0
  *info->write_pos++= chr;
575
0
  return 0;
576
0
}
Unexecuted instantiation: fuzz_json.c:my_b_write_byte
Unexecuted instantiation: json_lib.c:my_b_write_byte
Unexecuted instantiation: ctype-ucs2.c:my_b_write_byte
Unexecuted instantiation: dtoa.c:my_b_write_byte
Unexecuted instantiation: xml.c:my_b_write_byte
Unexecuted instantiation: ctype-simple.c:my_b_write_byte
Unexecuted instantiation: my_strtoll10.c:my_b_write_byte
Unexecuted instantiation: my_vsnprintf.c:my_b_write_byte
Unexecuted instantiation: my_malloc.c:my_b_write_byte
Unexecuted instantiation: my_static.c:my_b_write_byte
Unexecuted instantiation: my_thr_init.c:my_b_write_byte
Unexecuted instantiation: thr_mutex.c:my_b_write_byte
Unexecuted instantiation: thr_rwlock.c:my_b_write_byte
Unexecuted instantiation: psi_noop.c:my_b_write_byte
Unexecuted instantiation: my_error.c:my_b_write_byte
Unexecuted instantiation: my_getsystime.c:my_b_write_byte
Unexecuted instantiation: my_init.c:my_b_write_byte
Unexecuted instantiation: my_mess.c:my_b_write_byte
Unexecuted instantiation: my_once.c:my_b_write_byte
Unexecuted instantiation: my_symlink.c:my_b_write_byte
Unexecuted instantiation: my_sync.c:my_b_write_byte
Unexecuted instantiation: my_getpagesize.c:my_b_write_byte
Unexecuted instantiation: charset.c:my_b_write_byte
Unexecuted instantiation: errors.c:my_b_write_byte
Unexecuted instantiation: hash.c:my_b_write_byte
Unexecuted instantiation: mf_dirname.c:my_b_write_byte
Unexecuted instantiation: mf_loadpath.c:my_b_write_byte
Unexecuted instantiation: mf_pack.c:my_b_write_byte
Unexecuted instantiation: my_div.c:my_b_write_byte
Unexecuted instantiation: my_getwd.c:my_b_write_byte
Unexecuted instantiation: my_lib.c:my_b_write_byte
Unexecuted instantiation: my_open.c:my_b_write_byte
Unexecuted instantiation: my_read.c:my_b_write_byte
Unexecuted instantiation: array.c:my_b_write_byte
Unexecuted instantiation: charset-def.c:my_b_write_byte
Unexecuted instantiation: mf_qsort.c:my_b_write_byte
Unexecuted instantiation: my_alloc.c:my_b_write_byte
Unexecuted instantiation: ctype-tis620.c:my_b_write_byte
Unexecuted instantiation: str2int.c:my_b_write_byte
577
578
/**
579
  Fill buffer of the cache.
580
581
  @note It assumes that you have already used all characters in the CACHE,
582
        independent of the read_pos value!
583
584
  @returns
585
        0     On error or EOF (info->error = -1 on error)
586
        #     Number of characters
587
*/
588
static inline size_t my_b_fill(IO_CACHE *info)
589
0
{
590
0
  info->read_pos= info->read_end;
591
0
  return _my_b_read(info,0,0) ? 0 : (size_t) (info->read_end - info->read_pos);
592
0
}
Unexecuted instantiation: fuzz_json.c:my_b_fill
Unexecuted instantiation: json_lib.c:my_b_fill
Unexecuted instantiation: ctype-ucs2.c:my_b_fill
Unexecuted instantiation: dtoa.c:my_b_fill
Unexecuted instantiation: xml.c:my_b_fill
Unexecuted instantiation: ctype-simple.c:my_b_fill
Unexecuted instantiation: my_strtoll10.c:my_b_fill
Unexecuted instantiation: my_vsnprintf.c:my_b_fill
Unexecuted instantiation: my_malloc.c:my_b_fill
Unexecuted instantiation: my_static.c:my_b_fill
Unexecuted instantiation: my_thr_init.c:my_b_fill
Unexecuted instantiation: thr_mutex.c:my_b_fill
Unexecuted instantiation: thr_rwlock.c:my_b_fill
Unexecuted instantiation: psi_noop.c:my_b_fill
Unexecuted instantiation: my_error.c:my_b_fill
Unexecuted instantiation: my_getsystime.c:my_b_fill
Unexecuted instantiation: my_init.c:my_b_fill
Unexecuted instantiation: my_mess.c:my_b_fill
Unexecuted instantiation: my_once.c:my_b_fill
Unexecuted instantiation: my_symlink.c:my_b_fill
Unexecuted instantiation: my_sync.c:my_b_fill
Unexecuted instantiation: my_getpagesize.c:my_b_fill
Unexecuted instantiation: charset.c:my_b_fill
Unexecuted instantiation: errors.c:my_b_fill
Unexecuted instantiation: hash.c:my_b_fill
Unexecuted instantiation: mf_dirname.c:my_b_fill
Unexecuted instantiation: mf_loadpath.c:my_b_fill
Unexecuted instantiation: mf_pack.c:my_b_fill
Unexecuted instantiation: my_div.c:my_b_fill
Unexecuted instantiation: my_getwd.c:my_b_fill
Unexecuted instantiation: my_lib.c:my_b_fill
Unexecuted instantiation: my_open.c:my_b_fill
Unexecuted instantiation: my_read.c:my_b_fill
Unexecuted instantiation: array.c:my_b_fill
Unexecuted instantiation: charset-def.c:my_b_fill
Unexecuted instantiation: mf_qsort.c:my_b_fill
Unexecuted instantiation: my_alloc.c:my_b_fill
Unexecuted instantiation: ctype-tis620.c:my_b_fill
Unexecuted instantiation: str2int.c:my_b_fill
593
594
static inline my_off_t my_b_tell(const IO_CACHE *info)
595
0
{
596
0
  if (info->type == WRITE_CACHE) {
597
0
    return info->pos_in_file + (my_off_t)(info->write_pos - info->request_pos);
598
0
599
0
  }
600
0
  return info->pos_in_file + (my_off_t) (info->read_pos - info->request_pos);
601
0
}
Unexecuted instantiation: fuzz_json.c:my_b_tell
Unexecuted instantiation: json_lib.c:my_b_tell
Unexecuted instantiation: ctype-ucs2.c:my_b_tell
Unexecuted instantiation: dtoa.c:my_b_tell
Unexecuted instantiation: xml.c:my_b_tell
Unexecuted instantiation: ctype-simple.c:my_b_tell
Unexecuted instantiation: my_strtoll10.c:my_b_tell
Unexecuted instantiation: my_vsnprintf.c:my_b_tell
Unexecuted instantiation: my_malloc.c:my_b_tell
Unexecuted instantiation: my_static.c:my_b_tell
Unexecuted instantiation: my_thr_init.c:my_b_tell
Unexecuted instantiation: thr_mutex.c:my_b_tell
Unexecuted instantiation: thr_rwlock.c:my_b_tell
Unexecuted instantiation: psi_noop.c:my_b_tell
Unexecuted instantiation: my_error.c:my_b_tell
Unexecuted instantiation: my_getsystime.c:my_b_tell
Unexecuted instantiation: my_init.c:my_b_tell
Unexecuted instantiation: my_mess.c:my_b_tell
Unexecuted instantiation: my_once.c:my_b_tell
Unexecuted instantiation: my_symlink.c:my_b_tell
Unexecuted instantiation: my_sync.c:my_b_tell
Unexecuted instantiation: my_getpagesize.c:my_b_tell
Unexecuted instantiation: charset.c:my_b_tell
Unexecuted instantiation: errors.c:my_b_tell
Unexecuted instantiation: hash.c:my_b_tell
Unexecuted instantiation: mf_dirname.c:my_b_tell
Unexecuted instantiation: mf_loadpath.c:my_b_tell
Unexecuted instantiation: mf_pack.c:my_b_tell
Unexecuted instantiation: my_div.c:my_b_tell
Unexecuted instantiation: my_getwd.c:my_b_tell
Unexecuted instantiation: my_lib.c:my_b_tell
Unexecuted instantiation: my_open.c:my_b_tell
Unexecuted instantiation: my_read.c:my_b_tell
Unexecuted instantiation: array.c:my_b_tell
Unexecuted instantiation: charset-def.c:my_b_tell
Unexecuted instantiation: mf_qsort.c:my_b_tell
Unexecuted instantiation: my_alloc.c:my_b_tell
Unexecuted instantiation: ctype-tis620.c:my_b_tell
Unexecuted instantiation: str2int.c:my_b_tell
602
603
static inline my_off_t my_b_write_tell(const IO_CACHE *info)
604
0
{
605
0
  return info->pos_in_file + (my_off_t) (info->write_pos - info->write_buffer);
606
0
}
Unexecuted instantiation: fuzz_json.c:my_b_write_tell
Unexecuted instantiation: json_lib.c:my_b_write_tell
Unexecuted instantiation: ctype-ucs2.c:my_b_write_tell
Unexecuted instantiation: dtoa.c:my_b_write_tell
Unexecuted instantiation: xml.c:my_b_write_tell
Unexecuted instantiation: ctype-simple.c:my_b_write_tell
Unexecuted instantiation: my_strtoll10.c:my_b_write_tell
Unexecuted instantiation: my_vsnprintf.c:my_b_write_tell
Unexecuted instantiation: my_malloc.c:my_b_write_tell
Unexecuted instantiation: my_static.c:my_b_write_tell
Unexecuted instantiation: my_thr_init.c:my_b_write_tell
Unexecuted instantiation: thr_mutex.c:my_b_write_tell
Unexecuted instantiation: thr_rwlock.c:my_b_write_tell
Unexecuted instantiation: psi_noop.c:my_b_write_tell
Unexecuted instantiation: my_error.c:my_b_write_tell
Unexecuted instantiation: my_getsystime.c:my_b_write_tell
Unexecuted instantiation: my_init.c:my_b_write_tell
Unexecuted instantiation: my_mess.c:my_b_write_tell
Unexecuted instantiation: my_once.c:my_b_write_tell
Unexecuted instantiation: my_symlink.c:my_b_write_tell
Unexecuted instantiation: my_sync.c:my_b_write_tell
Unexecuted instantiation: my_getpagesize.c:my_b_write_tell
Unexecuted instantiation: charset.c:my_b_write_tell
Unexecuted instantiation: errors.c:my_b_write_tell
Unexecuted instantiation: hash.c:my_b_write_tell
Unexecuted instantiation: mf_dirname.c:my_b_write_tell
Unexecuted instantiation: mf_loadpath.c:my_b_write_tell
Unexecuted instantiation: mf_pack.c:my_b_write_tell
Unexecuted instantiation: my_div.c:my_b_write_tell
Unexecuted instantiation: my_getwd.c:my_b_write_tell
Unexecuted instantiation: my_lib.c:my_b_write_tell
Unexecuted instantiation: my_open.c:my_b_write_tell
Unexecuted instantiation: my_read.c:my_b_write_tell
Unexecuted instantiation: array.c:my_b_write_tell
Unexecuted instantiation: charset-def.c:my_b_write_tell
Unexecuted instantiation: mf_qsort.c:my_b_write_tell
Unexecuted instantiation: my_alloc.c:my_b_write_tell
Unexecuted instantiation: ctype-tis620.c:my_b_write_tell
Unexecuted instantiation: str2int.c:my_b_write_tell
607
608
static inline uchar* my_b_get_buffer_start(const IO_CACHE *info)
609
0
{
610
0
  return info->request_pos;
611
0
}
Unexecuted instantiation: fuzz_json.c:my_b_get_buffer_start
Unexecuted instantiation: json_lib.c:my_b_get_buffer_start
Unexecuted instantiation: ctype-ucs2.c:my_b_get_buffer_start
Unexecuted instantiation: dtoa.c:my_b_get_buffer_start
Unexecuted instantiation: xml.c:my_b_get_buffer_start
Unexecuted instantiation: ctype-simple.c:my_b_get_buffer_start
Unexecuted instantiation: my_strtoll10.c:my_b_get_buffer_start
Unexecuted instantiation: my_vsnprintf.c:my_b_get_buffer_start
Unexecuted instantiation: my_malloc.c:my_b_get_buffer_start
Unexecuted instantiation: my_static.c:my_b_get_buffer_start
Unexecuted instantiation: my_thr_init.c:my_b_get_buffer_start
Unexecuted instantiation: thr_mutex.c:my_b_get_buffer_start
Unexecuted instantiation: thr_rwlock.c:my_b_get_buffer_start
Unexecuted instantiation: psi_noop.c:my_b_get_buffer_start
Unexecuted instantiation: my_error.c:my_b_get_buffer_start
Unexecuted instantiation: my_getsystime.c:my_b_get_buffer_start
Unexecuted instantiation: my_init.c:my_b_get_buffer_start
Unexecuted instantiation: my_mess.c:my_b_get_buffer_start
Unexecuted instantiation: my_once.c:my_b_get_buffer_start
Unexecuted instantiation: my_symlink.c:my_b_get_buffer_start
Unexecuted instantiation: my_sync.c:my_b_get_buffer_start
Unexecuted instantiation: my_getpagesize.c:my_b_get_buffer_start
Unexecuted instantiation: charset.c:my_b_get_buffer_start
Unexecuted instantiation: errors.c:my_b_get_buffer_start
Unexecuted instantiation: hash.c:my_b_get_buffer_start
Unexecuted instantiation: mf_dirname.c:my_b_get_buffer_start
Unexecuted instantiation: mf_loadpath.c:my_b_get_buffer_start
Unexecuted instantiation: mf_pack.c:my_b_get_buffer_start
Unexecuted instantiation: my_div.c:my_b_get_buffer_start
Unexecuted instantiation: my_getwd.c:my_b_get_buffer_start
Unexecuted instantiation: my_lib.c:my_b_get_buffer_start
Unexecuted instantiation: my_open.c:my_b_get_buffer_start
Unexecuted instantiation: my_read.c:my_b_get_buffer_start
Unexecuted instantiation: array.c:my_b_get_buffer_start
Unexecuted instantiation: charset-def.c:my_b_get_buffer_start
Unexecuted instantiation: mf_qsort.c:my_b_get_buffer_start
Unexecuted instantiation: my_alloc.c:my_b_get_buffer_start
Unexecuted instantiation: ctype-tis620.c:my_b_get_buffer_start
Unexecuted instantiation: str2int.c:my_b_get_buffer_start
612
613
static inline size_t my_b_get_bytes_in_buffer(const IO_CACHE *info)
614
0
{
615
0
  return (size_t) (info->read_end - info->request_pos);
616
0
}
Unexecuted instantiation: fuzz_json.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: json_lib.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: ctype-ucs2.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: dtoa.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: xml.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: ctype-simple.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_strtoll10.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_vsnprintf.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_malloc.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_static.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_thr_init.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: thr_mutex.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: thr_rwlock.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: psi_noop.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_error.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_getsystime.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_init.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_mess.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_once.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_symlink.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_sync.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_getpagesize.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: charset.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: errors.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: hash.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: mf_dirname.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: mf_loadpath.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: mf_pack.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_div.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_getwd.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_lib.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_open.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_read.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: array.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: charset-def.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: mf_qsort.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: my_alloc.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: ctype-tis620.c:my_b_get_bytes_in_buffer
Unexecuted instantiation: str2int.c:my_b_get_bytes_in_buffer
617
618
static inline my_off_t my_b_get_pos_in_file(const IO_CACHE *info)
619
0
{
620
0
  return info->pos_in_file;
621
0
}
Unexecuted instantiation: fuzz_json.c:my_b_get_pos_in_file
Unexecuted instantiation: json_lib.c:my_b_get_pos_in_file
Unexecuted instantiation: ctype-ucs2.c:my_b_get_pos_in_file
Unexecuted instantiation: dtoa.c:my_b_get_pos_in_file
Unexecuted instantiation: xml.c:my_b_get_pos_in_file
Unexecuted instantiation: ctype-simple.c:my_b_get_pos_in_file
Unexecuted instantiation: my_strtoll10.c:my_b_get_pos_in_file
Unexecuted instantiation: my_vsnprintf.c:my_b_get_pos_in_file
Unexecuted instantiation: my_malloc.c:my_b_get_pos_in_file
Unexecuted instantiation: my_static.c:my_b_get_pos_in_file
Unexecuted instantiation: my_thr_init.c:my_b_get_pos_in_file
Unexecuted instantiation: thr_mutex.c:my_b_get_pos_in_file
Unexecuted instantiation: thr_rwlock.c:my_b_get_pos_in_file
Unexecuted instantiation: psi_noop.c:my_b_get_pos_in_file
Unexecuted instantiation: my_error.c:my_b_get_pos_in_file
Unexecuted instantiation: my_getsystime.c:my_b_get_pos_in_file
Unexecuted instantiation: my_init.c:my_b_get_pos_in_file
Unexecuted instantiation: my_mess.c:my_b_get_pos_in_file
Unexecuted instantiation: my_once.c:my_b_get_pos_in_file
Unexecuted instantiation: my_symlink.c:my_b_get_pos_in_file
Unexecuted instantiation: my_sync.c:my_b_get_pos_in_file
Unexecuted instantiation: my_getpagesize.c:my_b_get_pos_in_file
Unexecuted instantiation: charset.c:my_b_get_pos_in_file
Unexecuted instantiation: errors.c:my_b_get_pos_in_file
Unexecuted instantiation: hash.c:my_b_get_pos_in_file
Unexecuted instantiation: mf_dirname.c:my_b_get_pos_in_file
Unexecuted instantiation: mf_loadpath.c:my_b_get_pos_in_file
Unexecuted instantiation: mf_pack.c:my_b_get_pos_in_file
Unexecuted instantiation: my_div.c:my_b_get_pos_in_file
Unexecuted instantiation: my_getwd.c:my_b_get_pos_in_file
Unexecuted instantiation: my_lib.c:my_b_get_pos_in_file
Unexecuted instantiation: my_open.c:my_b_get_pos_in_file
Unexecuted instantiation: my_read.c:my_b_get_pos_in_file
Unexecuted instantiation: array.c:my_b_get_pos_in_file
Unexecuted instantiation: charset-def.c:my_b_get_pos_in_file
Unexecuted instantiation: mf_qsort.c:my_b_get_pos_in_file
Unexecuted instantiation: my_alloc.c:my_b_get_pos_in_file
Unexecuted instantiation: ctype-tis620.c:my_b_get_pos_in_file
Unexecuted instantiation: str2int.c:my_b_get_pos_in_file
622
623
static inline size_t my_b_bytes_in_cache(const IO_CACHE *info)
624
0
{
625
0
  if (info->type == WRITE_CACHE) {
626
0
    return (size_t) (info->write_end - info->write_pos);
627
0
  }
628
0
  return (size_t) (info->read_end - info->read_pos);
629
0
}
Unexecuted instantiation: fuzz_json.c:my_b_bytes_in_cache
Unexecuted instantiation: json_lib.c:my_b_bytes_in_cache
Unexecuted instantiation: ctype-ucs2.c:my_b_bytes_in_cache
Unexecuted instantiation: dtoa.c:my_b_bytes_in_cache
Unexecuted instantiation: xml.c:my_b_bytes_in_cache
Unexecuted instantiation: ctype-simple.c:my_b_bytes_in_cache
Unexecuted instantiation: my_strtoll10.c:my_b_bytes_in_cache
Unexecuted instantiation: my_vsnprintf.c:my_b_bytes_in_cache
Unexecuted instantiation: my_malloc.c:my_b_bytes_in_cache
Unexecuted instantiation: my_static.c:my_b_bytes_in_cache
Unexecuted instantiation: my_thr_init.c:my_b_bytes_in_cache
Unexecuted instantiation: thr_mutex.c:my_b_bytes_in_cache
Unexecuted instantiation: thr_rwlock.c:my_b_bytes_in_cache
Unexecuted instantiation: psi_noop.c:my_b_bytes_in_cache
Unexecuted instantiation: my_error.c:my_b_bytes_in_cache
Unexecuted instantiation: my_getsystime.c:my_b_bytes_in_cache
Unexecuted instantiation: my_init.c:my_b_bytes_in_cache
Unexecuted instantiation: my_mess.c:my_b_bytes_in_cache
Unexecuted instantiation: my_once.c:my_b_bytes_in_cache
Unexecuted instantiation: my_symlink.c:my_b_bytes_in_cache
Unexecuted instantiation: my_sync.c:my_b_bytes_in_cache
Unexecuted instantiation: my_getpagesize.c:my_b_bytes_in_cache
Unexecuted instantiation: charset.c:my_b_bytes_in_cache
Unexecuted instantiation: errors.c:my_b_bytes_in_cache
Unexecuted instantiation: hash.c:my_b_bytes_in_cache
Unexecuted instantiation: mf_dirname.c:my_b_bytes_in_cache
Unexecuted instantiation: mf_loadpath.c:my_b_bytes_in_cache
Unexecuted instantiation: mf_pack.c:my_b_bytes_in_cache
Unexecuted instantiation: my_div.c:my_b_bytes_in_cache
Unexecuted instantiation: my_getwd.c:my_b_bytes_in_cache
Unexecuted instantiation: my_lib.c:my_b_bytes_in_cache
Unexecuted instantiation: my_open.c:my_b_bytes_in_cache
Unexecuted instantiation: my_read.c:my_b_bytes_in_cache
Unexecuted instantiation: array.c:my_b_bytes_in_cache
Unexecuted instantiation: charset-def.c:my_b_bytes_in_cache
Unexecuted instantiation: mf_qsort.c:my_b_bytes_in_cache
Unexecuted instantiation: my_alloc.c:my_b_bytes_in_cache
Unexecuted instantiation: ctype-tis620.c:my_b_bytes_in_cache
Unexecuted instantiation: str2int.c:my_b_bytes_in_cache
630
631
int my_b_copy_to_file    (IO_CACHE *cache, FILE *file, size_t count);
632
int my_b_copy_all_to_file(IO_CACHE *cache, FILE *file);
633
int my_b_copy_to_cache(IO_CACHE *from_cache, IO_CACHE *to_cache, size_t count);
634
int my_b_copy_all_to_cache(IO_CACHE *from_cache, IO_CACHE *to_cache);
635
636
my_off_t my_b_append_tell(IO_CACHE* info);
637
my_off_t my_b_safe_tell(IO_CACHE* info); /* picks the correct tell() */
638
int my_b_pread(IO_CACHE *info, uchar *Buffer, size_t Count, my_off_t pos);
639
640
typedef uint32 ha_checksum;
641
642
extern int (*mysys_test_invalid_symlink)(const char *filename);
643
#include <my_alloc.h>
644
645
  /* Prototypes for mysys and my_func functions */
646
647
extern int my_copy(const char *from,const char *to,myf MyFlags);
648
extern int my_delete(const char *name,myf MyFlags);
649
extern int my_rmtree(const char *name, myf Myflags);
650
extern int my_getwd(char * buf,size_t size,myf MyFlags);
651
extern int my_setwd(const char *dir,myf MyFlags);
652
extern int my_lock(File fd,int op,my_off_t start, my_off_t length,myf MyFlags);
653
extern void *my_once_alloc(size_t Size,myf MyFlags);
654
extern void my_once_free(void);
655
extern char *my_once_strdup(const char *src,myf myflags);
656
extern void *my_once_memdup(const void *src, size_t len, myf myflags);
657
extern File my_open(const char *FileName,int Flags,myf MyFlags);
658
extern File my_register_filename(File fd, const char *FileName,
659
         enum file_type type_of_file,
660
         uint error_message_number, myf MyFlags);
661
extern File my_create(const char *FileName, mode_t CreateFlags,
662
          int AccessFlags, myf MyFlags);
663
extern int my_close(File Filedes,myf MyFlags);
664
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
665
extern int my_readlink(char *to, const char *filename, myf MyFlags);
666
extern int my_is_symlink(const char *filename);
667
extern int my_realpath(char *to, const char *filename, myf MyFlags);
668
extern File my_create_with_symlink(const char *linkname, const char *filename,
669
           mode_t createflags, int access_flags,
670
           myf MyFlags);
671
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
672
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
673
extern int my_handler_delete_with_symlink(const char *filename, myf sync_dir);
674
675
extern size_t my_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags);
676
extern size_t my_pread(File Filedes,uchar *Buffer,size_t Count,my_off_t offset,
677
         myf MyFlags);
678
extern int my_rename(const char *from,const char *to,myf MyFlags);
679
extern my_off_t my_seek(File fd,my_off_t pos,int whence,myf MyFlags);
680
extern my_off_t my_tell(File fd,myf MyFlags);
681
extern size_t my_write(File Filedes,const uchar *Buffer,size_t Count,
682
         myf MyFlags);
683
extern size_t my_pwrite(File Filedes,const uchar *Buffer,size_t Count,
684
          my_off_t offset,myf MyFlags);
685
extern size_t my_fread(FILE *stream,uchar *Buffer,size_t Count,myf MyFlags);
686
extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count,
687
          myf MyFlags);
688
extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags);
689
extern my_off_t my_ftell(FILE *stream,myf MyFlags);
690
extern void (*my_sleep_for_space)(unsigned int seconds);
691
692
extern int my_get_exepath(char *buf, size_t size, const char *argv0);
693
694
/* implemented in my_memmem.c */
695
extern void *my_memmem(const void *haystack, size_t haystacklen,
696
                       const void *needle, size_t needlelen);
697
698
699
#ifdef _WIN32
700
extern int      my_access(const char *path, int amode);
701
#define my_check_user(A,B) (NULL)
702
#define my_set_user(A,B,C) (0)
703
#else
704
#define my_access access
705
struct passwd *my_check_user(const char *user, myf MyFlags);
706
int my_set_user(const char *user, struct passwd *user_info, myf MyFlags);
707
#endif
708
709
extern int check_if_legal_filename(const char *path);
710
extern int check_if_legal_tablename(const char *path);
711
712
#ifdef _WIN32
713
extern my_bool is_filename_allowed(const char *name, size_t length,
714
                   my_bool allow_current_dir);
715
#else /* _WIN32 */
716
# define is_filename_allowed(name, length, allow_cwd) (TRUE)
717
#endif /* _WIN32 */ 
718
719
#ifdef _WIN32
720
/* Windows-only functions (CRT equivalents)*/
721
extern HANDLE   my_get_osfhandle(File fd);
722
extern File     my_win_handle2File(HANDLE hFile);
723
extern void     my_osmaperr(unsigned long last_error);
724
#endif
725
726
extern void init_glob_errs(void);
727
extern const char** get_global_errmsgs(int nr);
728
extern void wait_for_free_space(const char *filename, int errors);
729
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
730
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
731
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
732
extern int my_fclose(FILE *fd,myf MyFlags);
733
extern int my_vfprintf(FILE *stream, const char* format, va_list args)
734
  ATTRIBUTE_FORMAT(printf, 2, 0);
735
extern const char* my_strerror(char *buf, size_t len, int nr);
736
extern int my_fprintf(FILE *stream, const char* format, ...)
737
  ATTRIBUTE_FORMAT(printf, 2, 3);
738
extern File my_fileno(FILE *fd);
739
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
740
extern int my_chmod(const char *name, mode_t mode, myf my_flags);
741
extern const char *my_basename(const char *filename);
742
extern void thr_set_sync_wait_callback(void (*before_sync)(void),
743
                                       void (*after_sync)(void));
744
extern int my_sync(File fd, myf my_flags);
745
extern int my_sync_dir(const char *dir_name, myf my_flags);
746
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
747
extern const char *my_get_err_msg(uint nr);
748
extern int my_error_register(const char** (*get_errmsgs) (int nr),
749
                             uint first, uint last);
750
extern my_bool my_error_unregister(uint first, uint last);
751
extern void my_message(uint my_err, const char *str,myf MyFlags);
752
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
753
extern my_bool my_init(void);
754
extern void my_end(int infoflag);
755
extern int my_redel(const char *from, const char *to, time_t backup_time_stamp,
756
                    myf MyFlags);
757
void my_create_backup_name(char *to, const char *from,
758
                           time_t backup_time_stamp);
759
extern int my_copystat(const char *from, const char *to, int MyFlags);
760
extern char * my_filename(File fd);
761
762
extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);
763
extern char *my_tmpdir(MY_TMPDIR *tmpdir);
764
extern void free_tmpdir(MY_TMPDIR *tmpdir);
765
766
extern void my_remember_signal(int signal_number,sig_handler (*func)(int));
767
extern size_t dirname_part(char * to,const char *name, size_t *to_res_length);
768
extern size_t dirname_length(const char *name);
769
#define base_name(A) (A+dirname_length(A))
770
extern int test_if_hard_path(const char *dir_name);
771
extern my_bool has_path(const char *name);
772
extern char *convert_dirname(char *to, const char *from, const char *from_end);
773
extern void to_unix_path(char * name);
774
extern char * fn_ext(const char *name);
775
extern char * fn_ext2(const char *name);
776
extern char * fn_same(char * toname,const char *name,int flag);
777
extern char * fn_format(char * to,const char *name,const char *dir,
778
         const char *form, uint flag);
779
extern size_t strlength(const char *str);
780
extern void pack_dirname(char * to,const char *from);
781
extern size_t normalize_dirname(char * to, const char *from);
782
extern size_t unpack_dirname(char * to,const char *from);
783
extern size_t cleanup_dirname(char * to,const char *from);
784
extern size_t system_filename(char * to,const char *from);
785
extern size_t unpack_filename(char * to,const char *from);
786
extern char * intern_filename(char * to,const char *from);
787
extern int pack_filename(char * to, const char *name, size_t max_length);
788
extern char * my_path(char * to,const char *progname,
789
       const char *own_pathname_part);
790
extern char * my_load_path(char * to, const char *path,
791
            const char *own_path_prefix);
792
extern int wild_compare(const char *str,const char *wildstr,
793
                        pbool str_is_pattern);
794
extern my_bool array_append_string_unique(const char *str,
795
                                          const char **array, size_t size);
796
extern void get_date(char * to,int timeflag,time_t use_time);
797
extern void soundex(CHARSET_INFO *, char * out_pntr, char * in_pntr,
798
                    pbool remove_garbage);
799
extern int init_record_cache(RECORD_CACHE *info,size_t cachesize,File file,
800
           size_t reclength,enum cache_type type,
801
           pbool use_async_io);
802
extern int read_cache_record(RECORD_CACHE *info,uchar *to);
803
extern int end_record_cache(RECORD_CACHE *info);
804
extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos,
805
            const uchar *record,size_t length);
806
extern int flush_write_cache(RECORD_CACHE *info);
807
extern void handle_recived_signals(void);
808
809
extern sig_handler my_set_alarm_variable(int signo);
810
extern my_bool radixsort_is_applicable(uint n_items, size_t size_of_element);
811
extern void my_string_ptr_sort(uchar *base,uint items,size_t size);
812
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
813
          size_t size_of_element,uchar *buffer[]);
814
extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size,
815
                        qsort_cmp cmp);
816
extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size,
817
                         qsort_cmp2 cmp, void *cmp_argument);
818
extern qsort_cmp2 get_ptr_compare(size_t);
819
void my_store_ptr(uchar *buff, size_t pack_length, my_off_t pos);
820
my_off_t my_get_ptr(uchar *ptr, size_t pack_length);
821
extern int init_io_cache(IO_CACHE *info,File file,size_t cachesize,
822
       enum cache_type type,my_off_t seek_offset,
823
       my_bool use_async_io, myf cache_myflags);
824
extern int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize,
825
                              enum cache_type type, my_off_t seek_offset,
826
                              pbool use_async_io, myf cache_myflags,
827
                              PSI_file_key file_key);
828
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
829
             my_off_t seek_offset, my_bool use_async_io,
830
             my_bool clear_cache);
831
extern void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
832
                                IO_CACHE *write_cache, uint num_threads);
833
834
extern int init_slave_io_cache(IO_CACHE *master, IO_CACHE *slave);
835
void end_slave_io_cache(IO_CACHE *cache);
836
void seek_io_cache(IO_CACHE *cache, my_off_t needed_offset);
837
838
extern void remove_io_thread(IO_CACHE *info);
839
extern int my_b_append(IO_CACHE *info,const uchar *Buffer,size_t Count);
840
extern int my_b_safe_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
841
842
extern int my_block_write(IO_CACHE *info, const uchar *Buffer,
843
        size_t Count, my_off_t pos);
844
845
#define flush_io_cache(info) my_b_flush_io_cache((info),1)
846
847
extern int end_io_cache(IO_CACHE *info);
848
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
849
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
850
extern my_off_t my_b_filelength(IO_CACHE *info);
851
extern my_bool my_b_write_backtick_quote(IO_CACHE *info, const char *str,
852
                                         size_t len);
853
extern my_bool my_b_printf(IO_CACHE *info, const char* fmt, ...);
854
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
855
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
856
         const char *prefix, size_t cache_size,
857
         myf cache_myflags);
858
extern my_bool real_open_cached_file(IO_CACHE *cache);
859
extern void close_cached_file(IO_CACHE *cache);
860
extern File create_temp_file(char *to, const char *dir, const char *pfx,
861
                             int mode, myf MyFlags);
862
extern my_bool io_cache_tmp_file_track(IO_CACHE *info, ulonglong file_size);
863
864
0
#define my_init_dynamic_array(A,B,C,D,E,F) init_dynamic_array2(A,B,C,NULL,D,E,F)
865
#define my_init_dynamic_array2(A,B,C,D,E,F,G) init_dynamic_array2(A,B,C,D,E,F,G)
866
extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
867
                                   size_t element_size, void *init_buffer,
868
                                   size_t init_alloc, size_t alloc_increment,
869
                                   myf my_flags);
870
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void* element);
871
extern void *alloc_dynamic(DYNAMIC_ARRAY *array);
872
extern void *pop_dynamic(DYNAMIC_ARRAY*);
873
extern my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element,
874
                           size_t array_index);
875
extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, size_t max_elements);
876
extern void get_dynamic(DYNAMIC_ARRAY *array, void *element, size_t array_index);
877
extern void delete_dynamic(DYNAMIC_ARRAY *array);
878
extern void delete_dynamic_element(DYNAMIC_ARRAY *array, size_t array_index);
879
extern void delete_dynamic_with_callback(DYNAMIC_ARRAY *array, FREE_FUNC f);
880
extern void freeze_size(DYNAMIC_ARRAY *array);
881
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
882
0
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
883
0
#define push_dynamic(A,B) insert_dynamic((A),(B))
884
0
#define reset_dynamic(array) ((array)->elements= 0)
885
0
#define sort_dynamic(A,cmp) my_qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp))
886
extern void init_append_dynamic(DYNAMIC_ARRAY_APPEND *append,
887
                                DYNAMIC_ARRAY *array);
888
extern my_bool append_dynamic(DYNAMIC_ARRAY_APPEND *append,
889
                              const void * element);
890
891
extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
892
           size_t init_alloc,size_t alloc_increment);
893
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
894
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
895
        size_t length);
896
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
897
                                       ...);
898
extern my_bool dynstr_append_quoted(DYNAMIC_STRING *str,
899
                                    const char *append, size_t len,
900
                                    char quote);
901
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
902
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
903
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
904
extern void dynstr_free(DYNAMIC_STRING *str);
905
extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
906
                                        CHARSET_INFO *to_cs,
907
                                        const char *from, uint32 from_length,
908
                                        CHARSET_INFO *from_cs, uint *errors);
909
extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length,
910
                               size_t *alloc_length);
911
extern uint32 copy_and_convert_extended(char *to, uint32 to_length,
912
                                        CHARSET_INFO *to_cs,
913
                                        const char *from, uint32 from_length,
914
                                        CHARSET_INFO *from_cs, uint *errors);
915
#ifdef HAVE_MLOCK
916
extern void *my_malloc_lock(size_t length,myf flags);
917
extern void my_free_lock(void *ptr);
918
#else
919
#define my_malloc_lock(A,B) my_malloc(PSI_INSTRUMENT_ME, (A),(B))
920
#define my_free_lock(A) my_free((A))
921
#endif
922
#define alloc_root_inited(A) ((A)->min_malloc != 0)
923
#define DEFAULT_ROOT_BLOCK_SIZE 1024
924
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
925
extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
926
                            size_t block_size, size_t pre_alloc_size,
927
                            myf my_flags);
928
extern void *alloc_root(MEM_ROOT *mem_root, size_t Size);
929
extern void *multi_alloc_root(MEM_ROOT *mem_root, ...);
930
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
931
extern void move_root(MEM_ROOT *to, MEM_ROOT *from);
932
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
933
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
934
                                size_t prealloc_size);
935
extern void root_make_savepoint(MEM_ROOT *root, MEM_ROOT_SAVEPOINT *sv);
936
extern void root_free_to_savepoint(const MEM_ROOT_SAVEPOINT *sv);
937
extern void protect_root(MEM_ROOT *root, int prot);
938
extern char *strdup_root(MEM_ROOT *root,const char *str);
939
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
940
0
{
941
0
  return str ? strdup_root(root, str) : 0;
942
0
}
Unexecuted instantiation: fuzz_json.c:safe_strdup_root
Unexecuted instantiation: json_lib.c:safe_strdup_root
Unexecuted instantiation: ctype-ucs2.c:safe_strdup_root
Unexecuted instantiation: dtoa.c:safe_strdup_root
Unexecuted instantiation: xml.c:safe_strdup_root
Unexecuted instantiation: ctype-simple.c:safe_strdup_root
Unexecuted instantiation: my_strtoll10.c:safe_strdup_root
Unexecuted instantiation: my_vsnprintf.c:safe_strdup_root
Unexecuted instantiation: my_malloc.c:safe_strdup_root
Unexecuted instantiation: my_static.c:safe_strdup_root
Unexecuted instantiation: my_thr_init.c:safe_strdup_root
Unexecuted instantiation: thr_mutex.c:safe_strdup_root
Unexecuted instantiation: thr_rwlock.c:safe_strdup_root
Unexecuted instantiation: psi_noop.c:safe_strdup_root
Unexecuted instantiation: my_error.c:safe_strdup_root
Unexecuted instantiation: my_getsystime.c:safe_strdup_root
Unexecuted instantiation: my_init.c:safe_strdup_root
Unexecuted instantiation: my_mess.c:safe_strdup_root
Unexecuted instantiation: my_once.c:safe_strdup_root
Unexecuted instantiation: my_symlink.c:safe_strdup_root
Unexecuted instantiation: my_sync.c:safe_strdup_root
Unexecuted instantiation: my_getpagesize.c:safe_strdup_root
Unexecuted instantiation: charset.c:safe_strdup_root
Unexecuted instantiation: errors.c:safe_strdup_root
Unexecuted instantiation: hash.c:safe_strdup_root
Unexecuted instantiation: mf_dirname.c:safe_strdup_root
Unexecuted instantiation: mf_loadpath.c:safe_strdup_root
Unexecuted instantiation: mf_pack.c:safe_strdup_root
Unexecuted instantiation: my_div.c:safe_strdup_root
Unexecuted instantiation: my_getwd.c:safe_strdup_root
Unexecuted instantiation: my_lib.c:safe_strdup_root
Unexecuted instantiation: my_open.c:safe_strdup_root
Unexecuted instantiation: my_read.c:safe_strdup_root
Unexecuted instantiation: array.c:safe_strdup_root
Unexecuted instantiation: charset-def.c:safe_strdup_root
Unexecuted instantiation: mf_qsort.c:safe_strdup_root
Unexecuted instantiation: my_alloc.c:safe_strdup_root
Unexecuted instantiation: ctype-tis620.c:safe_strdup_root
Unexecuted instantiation: str2int.c:safe_strdup_root
943
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
944
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
945
946
extern LEX_CSTRING safe_lexcstrdup_root(MEM_ROOT *root, const LEX_CSTRING str);
947
948
static inline LEX_STRING lex_string_strmake_root(MEM_ROOT *mem_root,
949
                                                 const char *str, size_t length)
950
0
{
951
0
  LEX_STRING tmp;
952
0
  tmp.str= strmake_root(mem_root, str, length);
953
0
  tmp.length= tmp.str ? length : 0;
954
0
  return tmp;
955
0
}
Unexecuted instantiation: fuzz_json.c:lex_string_strmake_root
Unexecuted instantiation: json_lib.c:lex_string_strmake_root
Unexecuted instantiation: ctype-ucs2.c:lex_string_strmake_root
Unexecuted instantiation: dtoa.c:lex_string_strmake_root
Unexecuted instantiation: xml.c:lex_string_strmake_root
Unexecuted instantiation: ctype-simple.c:lex_string_strmake_root
Unexecuted instantiation: my_strtoll10.c:lex_string_strmake_root
Unexecuted instantiation: my_vsnprintf.c:lex_string_strmake_root
Unexecuted instantiation: my_malloc.c:lex_string_strmake_root
Unexecuted instantiation: my_static.c:lex_string_strmake_root
Unexecuted instantiation: my_thr_init.c:lex_string_strmake_root
Unexecuted instantiation: thr_mutex.c:lex_string_strmake_root
Unexecuted instantiation: thr_rwlock.c:lex_string_strmake_root
Unexecuted instantiation: psi_noop.c:lex_string_strmake_root
Unexecuted instantiation: my_error.c:lex_string_strmake_root
Unexecuted instantiation: my_getsystime.c:lex_string_strmake_root
Unexecuted instantiation: my_init.c:lex_string_strmake_root
Unexecuted instantiation: my_mess.c:lex_string_strmake_root
Unexecuted instantiation: my_once.c:lex_string_strmake_root
Unexecuted instantiation: my_symlink.c:lex_string_strmake_root
Unexecuted instantiation: my_sync.c:lex_string_strmake_root
Unexecuted instantiation: my_getpagesize.c:lex_string_strmake_root
Unexecuted instantiation: charset.c:lex_string_strmake_root
Unexecuted instantiation: errors.c:lex_string_strmake_root
Unexecuted instantiation: hash.c:lex_string_strmake_root
Unexecuted instantiation: mf_dirname.c:lex_string_strmake_root
Unexecuted instantiation: mf_loadpath.c:lex_string_strmake_root
Unexecuted instantiation: mf_pack.c:lex_string_strmake_root
Unexecuted instantiation: my_div.c:lex_string_strmake_root
Unexecuted instantiation: my_getwd.c:lex_string_strmake_root
Unexecuted instantiation: my_lib.c:lex_string_strmake_root
Unexecuted instantiation: my_open.c:lex_string_strmake_root
Unexecuted instantiation: my_read.c:lex_string_strmake_root
Unexecuted instantiation: array.c:lex_string_strmake_root
Unexecuted instantiation: charset-def.c:lex_string_strmake_root
Unexecuted instantiation: mf_qsort.c:lex_string_strmake_root
Unexecuted instantiation: my_alloc.c:lex_string_strmake_root
Unexecuted instantiation: ctype-tis620.c:lex_string_strmake_root
Unexecuted instantiation: str2int.c:lex_string_strmake_root
956
957
extern LEX_STRING lex_string_casedn_root(MEM_ROOT *root,
958
                                        CHARSET_INFO *cs,
959
                                        const char *str, size_t length);
960
961
static inline size_t root_size(MEM_ROOT *root)
962
0
{
963
0
  size_t k = root->block_num >> 2;
964
0
  return k * (k + 1) * 2 * root->block_size;
965
0
}
Unexecuted instantiation: fuzz_json.c:root_size
Unexecuted instantiation: json_lib.c:root_size
Unexecuted instantiation: ctype-ucs2.c:root_size
Unexecuted instantiation: dtoa.c:root_size
Unexecuted instantiation: xml.c:root_size
Unexecuted instantiation: ctype-simple.c:root_size
Unexecuted instantiation: my_strtoll10.c:root_size
Unexecuted instantiation: my_vsnprintf.c:root_size
Unexecuted instantiation: my_malloc.c:root_size
Unexecuted instantiation: my_static.c:root_size
Unexecuted instantiation: my_thr_init.c:root_size
Unexecuted instantiation: thr_mutex.c:root_size
Unexecuted instantiation: thr_rwlock.c:root_size
Unexecuted instantiation: psi_noop.c:root_size
Unexecuted instantiation: my_error.c:root_size
Unexecuted instantiation: my_getsystime.c:root_size
Unexecuted instantiation: my_init.c:root_size
Unexecuted instantiation: my_mess.c:root_size
Unexecuted instantiation: my_once.c:root_size
Unexecuted instantiation: my_symlink.c:root_size
Unexecuted instantiation: my_sync.c:root_size
Unexecuted instantiation: my_getpagesize.c:root_size
Unexecuted instantiation: charset.c:root_size
Unexecuted instantiation: errors.c:root_size
Unexecuted instantiation: hash.c:root_size
Unexecuted instantiation: mf_dirname.c:root_size
Unexecuted instantiation: mf_loadpath.c:root_size
Unexecuted instantiation: mf_pack.c:root_size
Unexecuted instantiation: my_div.c:root_size
Unexecuted instantiation: my_getwd.c:root_size
Unexecuted instantiation: my_lib.c:root_size
Unexecuted instantiation: my_open.c:root_size
Unexecuted instantiation: my_read.c:root_size
Unexecuted instantiation: array.c:root_size
Unexecuted instantiation: charset-def.c:root_size
Unexecuted instantiation: mf_qsort.c:root_size
Unexecuted instantiation: my_alloc.c:root_size
Unexecuted instantiation: ctype-tis620.c:root_size
Unexecuted instantiation: str2int.c:root_size
966
967
extern my_bool my_compress(uchar *, size_t *, size_t *);
968
extern my_bool my_uncompress(uchar *, size_t , size_t *);
969
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
970
                                size_t *complen);
971
extern void *my_az_allocator(void *dummy, unsigned int items, unsigned int size);
972
extern void my_az_free(void *dummy, void *address);
973
extern int my_compress_buffer(uchar *dest, size_t *destLen,
974
                              const uchar *source, size_t sourceLen);
975
extern int packfrm(const uchar *, size_t, uchar **, size_t *);
976
extern int unpackfrm(uchar **, size_t *, const uchar *);
977
978
extern uint32 my_checksum(uint32, const void *, size_t);
979
extern uint32 my_crc32c(uint32, const void *, size_t);
980
981
extern const char *my_crc32c_implementation();
982
983
#ifdef DBUG_ASSERT_EXISTS
984
extern void my_debug_put_break_here(void);
985
#else
986
#define my_debug_put_break_here() do {} while(0)
987
#endif
988
989
extern void my_sleep(ulong m_seconds);
990
extern uint my_set_max_open_files(uint files);
991
void my_free_open_file_info(void);
992
993
extern my_bool my_gethwaddr(uchar *to);
994
extern int my_getncpus(void);
995
996
#define HRTIME_RESOLUTION               1000000ULL  /* microseconds */
997
typedef struct {ulonglong val;} my_hrtime_t;
998
void my_time_init(void);
999
extern my_hrtime_t my_hrtime(void);
1000
1001
#ifdef _WIN32
1002
extern my_hrtime_t my_hrtime_coarse();
1003
#else
1004
#define my_hrtime_coarse() my_hrtime()
1005
#endif
1006
1007
extern ulonglong my_interval_timer(void);
1008
extern ulonglong my_getcputime(void);
1009
1010
#define microsecond_interval_timer()    (my_interval_timer()/1000)
1011
#define hrtime_to_time(X)               ((time_t)((X).val/HRTIME_RESOLUTION))
1012
#define hrtime_from_time(X)             ((ulonglong)((X)*HRTIME_RESOLUTION))
1013
#define hrtime_to_double(X)             ((X).val/(double)HRTIME_RESOLUTION)
1014
#define hrtime_sec_part(X)              ((ulong)((X).val % HRTIME_RESOLUTION))
1015
#define my_time(X)                      hrtime_to_time(my_hrtime_coarse())
1016
1017
/**
1018
  Make high resolution time from two parts.
1019
*/
1020
1021
static inline my_hrtime_t make_hr_time(my_time_t time, ulong time_sec_part)
1022
0
{
1023
0
  my_hrtime_t res= {((ulonglong) time)*1000000 + time_sec_part};
1024
0
  return res;
1025
0
}
Unexecuted instantiation: fuzz_json.c:make_hr_time
Unexecuted instantiation: json_lib.c:make_hr_time
Unexecuted instantiation: ctype-ucs2.c:make_hr_time
Unexecuted instantiation: dtoa.c:make_hr_time
Unexecuted instantiation: xml.c:make_hr_time
Unexecuted instantiation: ctype-simple.c:make_hr_time
Unexecuted instantiation: my_strtoll10.c:make_hr_time
Unexecuted instantiation: my_vsnprintf.c:make_hr_time
Unexecuted instantiation: my_malloc.c:make_hr_time
Unexecuted instantiation: my_static.c:make_hr_time
Unexecuted instantiation: my_thr_init.c:make_hr_time
Unexecuted instantiation: thr_mutex.c:make_hr_time
Unexecuted instantiation: thr_rwlock.c:make_hr_time
Unexecuted instantiation: psi_noop.c:make_hr_time
Unexecuted instantiation: my_error.c:make_hr_time
Unexecuted instantiation: my_getsystime.c:make_hr_time
Unexecuted instantiation: my_init.c:make_hr_time
Unexecuted instantiation: my_mess.c:make_hr_time
Unexecuted instantiation: my_once.c:make_hr_time
Unexecuted instantiation: my_symlink.c:make_hr_time
Unexecuted instantiation: my_sync.c:make_hr_time
Unexecuted instantiation: my_getpagesize.c:make_hr_time
Unexecuted instantiation: charset.c:make_hr_time
Unexecuted instantiation: errors.c:make_hr_time
Unexecuted instantiation: hash.c:make_hr_time
Unexecuted instantiation: mf_dirname.c:make_hr_time
Unexecuted instantiation: mf_loadpath.c:make_hr_time
Unexecuted instantiation: mf_pack.c:make_hr_time
Unexecuted instantiation: my_div.c:make_hr_time
Unexecuted instantiation: my_getwd.c:make_hr_time
Unexecuted instantiation: my_lib.c:make_hr_time
Unexecuted instantiation: my_open.c:make_hr_time
Unexecuted instantiation: my_read.c:make_hr_time
Unexecuted instantiation: array.c:make_hr_time
Unexecuted instantiation: charset-def.c:make_hr_time
Unexecuted instantiation: mf_qsort.c:make_hr_time
Unexecuted instantiation: my_alloc.c:make_hr_time
Unexecuted instantiation: ctype-tis620.c:make_hr_time
Unexecuted instantiation: str2int.c:make_hr_time
1026
1027
1028
#if STACK_DIRECTION < 0
1029
#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END))
1030
#else
1031
#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR))
1032
#endif
1033
1034
#ifndef MAP_SYNC
1035
#define MAP_SYNC 0x80000
1036
#endif
1037
#ifndef MAP_SHARED_VALIDATE
1038
#define MAP_SHARED_VALIDATE 0x03
1039
#endif
1040
1041
#ifdef HAVE_SYS_MMAN_H
1042
#ifndef MAP_NOSYNC
1043
#define MAP_NOSYNC      0
1044
#endif
1045
#ifndef MAP_NORESERVE
1046
#define MAP_NORESERVE 0         /* For irix and AIX */
1047
#endif
1048
1049
#ifdef HAVE_MMAP64
1050
0
#define my_mmap(a,b,c,d,e,f)    mmap64(a,b,c,d,e,f)
1051
#else
1052
#define my_mmap(a,b,c,d,e,f)    mmap(a,b,c,d,e,f)
1053
#endif
1054
0
#define my_munmap(a,b)          munmap((a),(b))
1055
1056
#else
1057
/* not a complete set of mmap() flags, but only those that necessary */
1058
#define PROT_READ        1
1059
#define PROT_WRITE       2
1060
#define MAP_NORESERVE    0
1061
#define MAP_SHARED       0x0001
1062
#define MAP_PRIVATE      0x0002
1063
#define MAP_NOSYNC       0x0800
1064
#define MAP_FAILED       ((void *)-1)
1065
#define MS_SYNC          0x0000
1066
1067
#define HAVE_MMAP
1068
void *my_mmap(void *, size_t, int, int, int, my_off_t);
1069
int my_munmap(void *, size_t);
1070
#endif
1071
1072
#ifdef _WIN32
1073
extern FILE* my_win_popen(const char*, const char*);
1074
extern int my_win_pclose(FILE*);
1075
#define my_popen(A,B) my_win_popen(A,B)
1076
#define my_pclose(A) my_win_pclose(A)
1077
#else
1078
#define my_popen(A,B) popen(A,B)
1079
#define my_pclose(A) pclose(A)
1080
#endif
1081
1082
/* my_getpagesize */
1083
int my_getpagesize(void);
1084
1085
int my_msync(int, void *, size_t, int);
1086
1087
#define MY_UUID_SIZE 16
1088
#define MY_UUID_BARE_STRING_LENGTH (8+4+4+4+12)
1089
#define MY_UUID_SEPARATORS 4
1090
#define MY_UUID_STRING_LENGTH (MY_UUID_BARE_STRING_LENGTH + MY_UUID_SEPARATORS)
1091
1092
void my_uuid_init(ulong seed1, ulong seed2);
1093
void my_uuid(uchar *guid);
1094
void my_uuid_end(void);
1095
1096
static inline void my_uuid2str(const uchar *guid, char *s, int with_separators)
1097
0
{
1098
0
  int i;
1099
0
  int mask= with_separators ? ((1 << 3) | (1 << 5) | (1 << 7) | (1 << 9)) : 0;
1100
0
  for (i=0; i < MY_UUID_SIZE; i++, mask >>= 1)
1101
0
  {
1102
0
    *s++= _dig_vec_lower[guid[i] >>4];
1103
0
    *s++= _dig_vec_lower[guid[i] & 15];
1104
0
    if (mask & 1)
1105
0
      *s++= '-';
1106
0
  }
1107
0
}
Unexecuted instantiation: fuzz_json.c:my_uuid2str
Unexecuted instantiation: json_lib.c:my_uuid2str
Unexecuted instantiation: ctype-ucs2.c:my_uuid2str
Unexecuted instantiation: dtoa.c:my_uuid2str
Unexecuted instantiation: xml.c:my_uuid2str
Unexecuted instantiation: ctype-simple.c:my_uuid2str
Unexecuted instantiation: my_strtoll10.c:my_uuid2str
Unexecuted instantiation: my_vsnprintf.c:my_uuid2str
Unexecuted instantiation: my_malloc.c:my_uuid2str
Unexecuted instantiation: my_static.c:my_uuid2str
Unexecuted instantiation: my_thr_init.c:my_uuid2str
Unexecuted instantiation: thr_mutex.c:my_uuid2str
Unexecuted instantiation: thr_rwlock.c:my_uuid2str
Unexecuted instantiation: psi_noop.c:my_uuid2str
Unexecuted instantiation: my_error.c:my_uuid2str
Unexecuted instantiation: my_getsystime.c:my_uuid2str
Unexecuted instantiation: my_init.c:my_uuid2str
Unexecuted instantiation: my_mess.c:my_uuid2str
Unexecuted instantiation: my_once.c:my_uuid2str
Unexecuted instantiation: my_symlink.c:my_uuid2str
Unexecuted instantiation: my_sync.c:my_uuid2str
Unexecuted instantiation: my_getpagesize.c:my_uuid2str
Unexecuted instantiation: charset.c:my_uuid2str
Unexecuted instantiation: errors.c:my_uuid2str
Unexecuted instantiation: hash.c:my_uuid2str
Unexecuted instantiation: mf_dirname.c:my_uuid2str
Unexecuted instantiation: mf_loadpath.c:my_uuid2str
Unexecuted instantiation: mf_pack.c:my_uuid2str
Unexecuted instantiation: my_div.c:my_uuid2str
Unexecuted instantiation: my_getwd.c:my_uuid2str
Unexecuted instantiation: my_lib.c:my_uuid2str
Unexecuted instantiation: my_open.c:my_uuid2str
Unexecuted instantiation: my_read.c:my_uuid2str
Unexecuted instantiation: array.c:my_uuid2str
Unexecuted instantiation: charset-def.c:my_uuid2str
Unexecuted instantiation: mf_qsort.c:my_uuid2str
Unexecuted instantiation: my_alloc.c:my_uuid2str
Unexecuted instantiation: ctype-tis620.c:my_uuid2str
Unexecuted instantiation: str2int.c:my_uuid2str
1108
1109
1110
const char *my_dlerror(const char *dlpath);
1111
1112
1113
/* System timezone handling*/
1114
void my_tzset();
1115
void my_tzname(char *sys_timezone, size_t size);
1116
1117
struct my_tz
1118
{
1119
  long seconds_offset;
1120
  char abbreviation[64];
1121
};
1122
void my_tzinfo(time_t t, struct my_tz*);
1123
1124
/* character sets */
1125
extern void my_charset_loader_init_mysys(MY_CHARSET_LOADER *loader);
1126
extern uint get_charset_number(const char *cs_name, uint cs_flags, myf flags);
1127
extern uint get_collation_number(const char *name,myf flags);
1128
extern const char *get_charset_name(uint cs_number);
1129
1130
extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
1131
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
1132
extern CHARSET_INFO *my_collation_get_by_name(MY_CHARSET_LOADER *loader,
1133
                                              const char *name, myf flags);
1134
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
1135
             uint cs_flags, myf my_flags);
1136
extern CHARSET_INFO *my_charset_get_by_name(MY_CHARSET_LOADER *loader,
1137
                                            const char *name,
1138
                                            uint cs_flags, myf my_flags);
1139
extern my_bool resolve_charset(const char *cs_name,
1140
                               CHARSET_INFO *default_cs,
1141
                               CHARSET_INFO **cs,
1142
                               myf flags);
1143
extern my_bool resolve_collation(const char *cl_name,
1144
                                 CHARSET_INFO *default_cl,
1145
                                 CHARSET_INFO **cl,
1146
                                 myf my_flags);
1147
extern void free_charsets(void);
1148
extern char *get_charsets_dir(char *buf);
1149
static inline my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
1150
0
{
1151
0
  return (cs1->cs_name.str == cs2->cs_name.str);
1152
0
}
Unexecuted instantiation: fuzz_json.c:my_charset_same
Unexecuted instantiation: json_lib.c:my_charset_same
Unexecuted instantiation: ctype-ucs2.c:my_charset_same
Unexecuted instantiation: dtoa.c:my_charset_same
Unexecuted instantiation: xml.c:my_charset_same
Unexecuted instantiation: ctype-simple.c:my_charset_same
Unexecuted instantiation: my_strtoll10.c:my_charset_same
Unexecuted instantiation: my_vsnprintf.c:my_charset_same
Unexecuted instantiation: my_malloc.c:my_charset_same
Unexecuted instantiation: my_static.c:my_charset_same
Unexecuted instantiation: my_thr_init.c:my_charset_same
Unexecuted instantiation: thr_mutex.c:my_charset_same
Unexecuted instantiation: thr_rwlock.c:my_charset_same
Unexecuted instantiation: psi_noop.c:my_charset_same
Unexecuted instantiation: my_error.c:my_charset_same
Unexecuted instantiation: my_getsystime.c:my_charset_same
Unexecuted instantiation: my_init.c:my_charset_same
Unexecuted instantiation: my_mess.c:my_charset_same
Unexecuted instantiation: my_once.c:my_charset_same
Unexecuted instantiation: my_symlink.c:my_charset_same
Unexecuted instantiation: my_sync.c:my_charset_same
Unexecuted instantiation: my_getpagesize.c:my_charset_same
Unexecuted instantiation: charset.c:my_charset_same
Unexecuted instantiation: errors.c:my_charset_same
Unexecuted instantiation: hash.c:my_charset_same
Unexecuted instantiation: mf_dirname.c:my_charset_same
Unexecuted instantiation: mf_loadpath.c:my_charset_same
Unexecuted instantiation: mf_pack.c:my_charset_same
Unexecuted instantiation: my_div.c:my_charset_same
Unexecuted instantiation: my_getwd.c:my_charset_same
Unexecuted instantiation: my_lib.c:my_charset_same
Unexecuted instantiation: my_open.c:my_charset_same
Unexecuted instantiation: my_read.c:my_charset_same
Unexecuted instantiation: array.c:my_charset_same
Unexecuted instantiation: charset-def.c:my_charset_same
Unexecuted instantiation: mf_qsort.c:my_charset_same
Unexecuted instantiation: my_alloc.c:my_charset_same
Unexecuted instantiation: ctype-tis620.c:my_charset_same
Unexecuted instantiation: str2int.c:my_charset_same
1153
extern my_bool init_compiled_charsets(myf flags);
1154
extern int add_compiled_collation(struct charset_info_st *cs);
1155
extern void add_compiled_extra_collation(struct charset_info_st *cs);
1156
extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info,
1157
                                      char *to, size_t to_length,
1158
                                      const char *from, size_t length,
1159
                                      my_bool *overflow);
1160
extern char *my_get_tty_password(const char *opt_message);
1161
#ifdef _WIN32
1162
#define BACKSLASH_MBTAIL
1163
/* File system character set */
1164
extern CHARSET_INFO *fs_character_set(void);
1165
extern int my_set_console_cp(const char *name);
1166
#else
1167
#define my_set_console_cp(A) do {} while (0)
1168
#endif
1169
extern const char *my_default_csname(void);
1170
extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
1171
                                      char *to, size_t to_length,
1172
                                      const char *from, size_t length,
1173
                                      my_bool *overflow);
1174
1175
extern void thd_increment_bytes_sent(void *thd, size_t length);
1176
extern void thd_increment_bytes_received(void *thd, size_t length);
1177
extern void thd_increment_net_big_packet_count(void *thd, size_t length);
1178
1179
#include <mysql/psi/psi.h>
1180
1181
#ifdef HAVE_PSI_INTERFACE
1182
extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook;
1183
extern void set_psi_server(PSI *psi);
1184
void my_init_mysys_psi_keys(void);
1185
#endif
1186
1187
struct st_mysql_file;
1188
extern struct st_mysql_file *mysql_stdin;
1189
C_MODE_END
1190
1191
1192
#ifdef __cplusplus
1193
1194
class Charset_loader_mysys: public MY_CHARSET_LOADER
1195
{
1196
public:
1197
  Charset_loader_mysys()
1198
  {
1199
    my_charset_loader_init_mysys(this);
1200
  }
1201
1202
  /**
1203
    Get a CHARSET_INFO by a character set name.
1204
1205
    @param name      Collation name
1206
    @param cs_flags  e.g. MY_CS_PRIMARY, MY_CS_BINARY
1207
    @param my_flags  mysys flags (MY_WME, MY_UTF8_IS_UTF8MB3)
1208
    @return
1209
    @retval          NULL on error (e.g. not found)
1210
    @retval          A CHARSET_INFO pointter on success
1211
  */
1212
  CHARSET_INFO *get_charset(const char *cs_name, uint cs_flags, myf my_flags)
1213
  {
1214
    error[0]= '\0'; // Need to clear in case of the second call
1215
    return my_charset_get_by_name(this, cs_name, cs_flags, my_flags);
1216
  }
1217
1218
  /**
1219
    Get a CHARSET_INFO by an exact collation by name.
1220
1221
    @param name      Collation name
1222
    @param my_flags  e.g. the utf8 translation flag
1223
    @return
1224
    @retval          NULL on error (e.g. not found)
1225
    @retval          A CHARSET_INFO pointter on success
1226
  */
1227
  CHARSET_INFO *get_exact_collation(const char *name, myf my_flags)
1228
  {
1229
    error[0]= '\0'; // Need to clear in case of the second call
1230
    return my_collation_get_by_name(this, name, my_flags);
1231
  }
1232
1233
  /**
1234
    Get a CHARSET_INFO by a context collation by name.
1235
    The returned pointer must be further resolved to a character set.
1236
1237
    @param name      Collation name
1238
    @param utf8_flag The utf8 translation flag
1239
    @return
1240
    @retval          NULL on error (e.g. not found)
1241
    @retval          A CHARSET_INFO pointter on success
1242
  */
1243
  CHARSET_INFO *get_context_collation(const char *name, myf my_flags)
1244
  {
1245
    return get_exact_collation_by_context_name(&my_charset_utf8mb4_general_ci,
1246
                                               name, my_flags);
1247
  }
1248
1249
  /**
1250
    Get an exact CHARSET_INFO by a contextually typed collation name.
1251
1252
    @param name      Collation name
1253
    @param utf8_flag The utf8 translation flag
1254
    @return
1255
    @retval          NULL on error (e.g. not found)
1256
    @retval          A CHARSET_INFO pointer on success
1257
  */
1258
  CHARSET_INFO *get_exact_collation_by_context_name(CHARSET_INFO *cs,
1259
                                                    const char *name,
1260
                                                    myf my_flags)
1261
  {
1262
    char tmp[MY_CS_COLLATION_NAME_SIZE];
1263
    my_snprintf(tmp, sizeof(tmp), "%s_%s", cs->cs_name.str, name);
1264
    return get_exact_collation(tmp, my_flags);
1265
  }
1266
1267
  /*
1268
    Find a collation with binary comparison rules
1269
  */
1270
  CHARSET_INFO *get_bin_collation(CHARSET_INFO *cs, myf my_flags)
1271
  {
1272
    /*
1273
      We don't need to handle old_mode=UTF8_IS_UTF8MB3 here,
1274
      This method assumes that "cs" points to a real character set name.
1275
      It can be either "utf8mb3" or "utf8mb4". It cannot be "utf8".
1276
      No thd->get_utf8_flag() flag passed to get_charset_by_csname().
1277
    */
1278
    DBUG_ASSERT(cs->cs_name.length !=4 || memcmp(cs->cs_name.str, "utf8", 4));
1279
    /*
1280
      CREATE TABLE t1 (a CHAR(10) BINARY)
1281
        CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
1282
      Nothing to do, we have the binary collation already.
1283
    */
1284
    if (cs->state & MY_CS_BINSORT)
1285
      return cs;
1286
1287
    // CREATE TABLE t1 (a CHAR(10) BINARY) CHARACTER SET utf8mb4;/
1288
    error[0]= '\0'; // Need in case of the second execution
1289
    return get_charset(cs->cs_name.str, MY_CS_BINSORT, my_flags);
1290
  }
1291
1292
  /*
1293
    Find the default collation in the given character set
1294
  */
1295
  CHARSET_INFO *get_default_collation(CHARSET_INFO *cs, myf my_flags)
1296
  {
1297
    // See comments in find_bin_collation_or_error()
1298
    DBUG_ASSERT(cs->cs_name.length !=4 || memcmp(cs->cs_name.str, "utf8", 4));
1299
    /*
1300
      CREATE TABLE t1 (a CHAR(10) COLLATE DEFAULT) CHARACTER SET utf8mb4;
1301
      Nothing to do, we have the default collation already.
1302
    */
1303
    if (cs->state & MY_CS_PRIMARY)
1304
      return cs;
1305
    /*
1306
      CREATE TABLE t1 (a CHAR(10) COLLATE DEFAULT)
1307
        CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
1308
1309
      Don't need to handle old_mode=UTF8_IS_UTF8MB3 here.
1310
      See comments in find_bin_collation_or_error.
1311
    */
1312
    cs= get_charset(cs->cs_name.str, MY_CS_PRIMARY, my_flags);
1313
    DBUG_ASSERT(cs);
1314
    return cs;
1315
  }
1316
};
1317
1318
#endif /*__cplusplus */
1319
1320
1321
#endif /* _my_sys_h */