Coverage Report

Created: 2024-06-18 07:03

/src/server/mysys/my_static.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
2
   Copyright (c) 2009, 2019, 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 St, Fifth Floor, Boston, MA 02110-1335  USA */
16
17
/*
18
  Static variables for mysys library. All definied here for easy making of
19
  a shared library
20
*/
21
22
#include "mysys_priv.h"
23
#include "my_static.h"
24
25
PSI_memory_key key_memory_DYNAMIC_STRING;
26
PSI_memory_key key_memory_IO_CACHE;
27
PSI_memory_key key_memory_KEY_CACHE;
28
PSI_memory_key key_memory_LIST;
29
PSI_memory_key key_memory_MY_BITMAP_bitmap;
30
PSI_memory_key key_memory_MY_DIR;
31
PSI_memory_key key_memory_MY_STAT;
32
PSI_memory_key key_memory_MY_TMPDIR_full_list;
33
PSI_memory_key key_memory_QUEUE;
34
PSI_memory_key key_memory_SAFE_HASH_ENTRY;
35
PSI_memory_key key_memory_THD_ALARM;
36
PSI_memory_key key_memory_TREE;
37
PSI_memory_key key_memory_charset_file;
38
PSI_memory_key key_memory_charset_loader;
39
PSI_memory_key key_memory_defaults;
40
PSI_memory_key key_memory_lf_dynarray;
41
PSI_memory_key key_memory_lf_node;
42
PSI_memory_key key_memory_lf_slist;
43
PSI_memory_key key_memory_max_alloca;
44
PSI_memory_key key_memory_my_compress_alloc;
45
PSI_memory_key key_memory_my_err_head;
46
PSI_memory_key key_memory_my_file_info;
47
PSI_memory_key key_memory_pack_frm;
48
PSI_memory_key key_memory_charsets;
49
PSI_memory_key key_memory_new= PSI_INSTRUMENT_MEM;
50
51
#ifdef _WIN32
52
PSI_memory_key key_memory_win_SECURITY_ATTRIBUTES;
53
PSI_memory_key key_memory_win_PACL;
54
PSI_memory_key key_memory_win_IP_ADAPTER_ADDRESSES;
55
#endif /* _WIN32 */
56
57
  /* from my_init */
58
char *home_dir=0;
59
char *mysql_data_home= (char*) ".";
60
const char      *my_progname= NULL, *my_progname_short= NULL;
61
char    curr_dir[FN_REFLEN]= {0},
62
    home_dir_buff[FN_REFLEN]= {0};
63
ulong   my_stream_opened=0,my_tmp_file_created=0;
64
ulong           my_file_total_opened= 0;
65
int   my_umask=0664, my_umask_dir=0777;
66
#ifdef _WIN32
67
SECURITY_ATTRIBUTES my_dir_security_attributes= {sizeof(SECURITY_ATTRIBUTES),NULL,FALSE};
68
#endif
69
myf             my_global_flags= 0;
70
#ifndef DBUG_OFF
71
my_bool         my_assert= 1;
72
#endif
73
my_bool         my_assert_on_error= 0;
74
struct st_my_file_info my_file_info_default[MY_NFILE];
75
uint   my_file_limit= MY_NFILE;
76
int32           my_file_opened=0;
77
struct st_my_file_info *my_file_info= my_file_info_default;
78
79
  /* From mf_brkhant */
80
int     my_dont_interrupt=0;
81
volatile int    _my_signals=0;
82
struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}};
83
84
  /* from mf_reccache.c */
85
ulong my_default_record_cache_size=RECORD_CACHE_SIZE;
86
87
  /* from soundex.c */
88
        /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */
89
        /* :::::::::::::::::::::::::: */
90
const char *soundex_map=    "01230120022455012623010202";
91
92
  /* from my_malloc */
93
USED_MEM* my_once_root_block=0;     /* pointer to first block */
94
uint    my_once_extra=ONCE_ALLOC_INIT;  /* Memory to alloc / block */
95
96
97
  /* from errors.c */
98
#ifdef SHARED_LIBRARY
99
const char *globerrs[GLOBERRS];   /* my_error_messages is here */
100
#endif
101
void (*error_handler_hook)(uint error, const char *str, myf MyFlags)=
102
  my_message_stderr;
103
void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)=
104
  my_message_stderr;
105
106
static void proc_info_dummy(void *a __attribute__((unused)),
107
                            const PSI_stage_info *b __attribute__((unused)),
108
                            PSI_stage_info *c __attribute__((unused)),
109
                            const char *d __attribute__((unused)),
110
                            const char *e __attribute__((unused)),
111
                            const unsigned int f __attribute__((unused)))
112
0
{
113
0
  return;
114
0
}
115
116
/* this is to be able to call set_thd_proc_info from the C code */
117
void (*proc_info_hook)(void *, const PSI_stage_info *, PSI_stage_info *,
118
                       const char *, const char *, const unsigned int)= proc_info_dummy;
119
void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t)= 0;
120
121
  /* How to disable options */
122
my_bool my_disable_locking=0;
123
my_bool my_disable_sync=0;
124
my_bool my_disable_async_io=0;
125
my_bool my_disable_flush_key_blocks=0;
126
my_bool my_disable_symlinks=0;
127
my_bool my_disable_copystat_in_redel=0;
128
129
/* Typelib by all clients */
130
const char *sql_protocol_names_lib[] =
131
{ "TCP", "SOCKET", "PIPE", NullS };
132
133
TYPELIB sql_protocol_typelib ={ array_elements(sql_protocol_names_lib) - 1, "",
134
                                sql_protocol_names_lib, NULL };