1 | /* Copyright (c) 2000, 2011, Oracle and/or its affiliates. |
2 | Copyright (c) 2009, 2012, Monty Program Ab. |
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-1301 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 | #include "my_alarm.h" |
25 | |
26 | my_bool timed_mutexes= 0; |
27 | |
28 | /* from my_init */ |
29 | char * home_dir=0; |
30 | char *mysql_data_home= (char*) "." ; |
31 | const char *my_progname= NULL, *my_progname_short= NULL; |
32 | char curr_dir[FN_REFLEN]= {0}, |
33 | home_dir_buff[FN_REFLEN]= {0}; |
34 | ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0; |
35 | ulong my_file_total_opened= 0; |
36 | int my_umask=0664, my_umask_dir=0777; |
37 | |
38 | myf my_global_flags= 0; |
39 | my_bool my_assert_on_error= 0; |
40 | struct st_my_file_info my_file_info_default[MY_NFILE]; |
41 | uint my_file_limit= MY_NFILE; |
42 | struct st_my_file_info *my_file_info= my_file_info_default; |
43 | |
44 | /* From mf_brkhant */ |
45 | int my_dont_interrupt=0; |
46 | volatile int _my_signals=0; |
47 | struct st_remember _my_sig_remember[MAX_SIGNALS]={{0,0}}; |
48 | |
49 | /* from mf_reccache.c */ |
50 | ulong my_default_record_cache_size=RECORD_CACHE_SIZE; |
51 | |
52 | /* from soundex.c */ |
53 | /* ABCDEFGHIJKLMNOPQRSTUVWXYZ */ |
54 | /* :::::::::::::::::::::::::: */ |
55 | const char *soundex_map= "01230120022455012623010202" ; |
56 | |
57 | /* from my_malloc */ |
58 | USED_MEM* my_once_root_block=0; /* pointer to first block */ |
59 | uint =ONCE_ALLOC_INIT; /* Memory to alloc / block */ |
60 | |
61 | /* from my_largepage.c */ |
62 | #ifdef HAVE_LINUX_LARGE_PAGES |
63 | my_bool my_use_large_pages= 0; |
64 | uint my_large_page_size= 0; |
65 | #endif |
66 | |
67 | /* from my_alarm */ |
68 | int volatile my_have_got_alarm=0; /* declare variable to reset */ |
69 | ulong my_time_to_wait_for_lock=2; /* In seconds */ |
70 | |
71 | /* from errors.c */ |
72 | #ifdef SHARED_LIBRARY |
73 | const char *globerrs[GLOBERRS]; /* my_error_messages is here */ |
74 | #endif |
75 | void (*error_handler_hook)(uint error, const char *str, myf MyFlags)= |
76 | my_message_stderr; |
77 | void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)= |
78 | my_message_stderr; |
79 | |
80 | static void proc_info_dummy(void *a __attribute__((unused)), |
81 | const PSI_stage_info *b __attribute__((unused)), |
82 | PSI_stage_info *c __attribute__((unused)), |
83 | const char *d __attribute__((unused)), |
84 | const char *e __attribute__((unused)), |
85 | const unsigned int f __attribute__((unused))) |
86 | { |
87 | return; |
88 | } |
89 | |
90 | /* this is to be able to call set_thd_proc_info from the C code */ |
91 | void (*proc_info_hook)(void *, const PSI_stage_info *, PSI_stage_info *, |
92 | const char *, const char *, const unsigned int)= proc_info_dummy; |
93 | void (*debug_sync_C_callback_ptr)(MYSQL_THD, const char *, size_t)= 0; |
94 | |
95 | /* How to disable options */ |
96 | my_bool my_disable_locking=0; |
97 | my_bool my_disable_sync=0; |
98 | my_bool my_disable_async_io=0; |
99 | my_bool my_disable_flush_key_blocks=0; |
100 | my_bool my_disable_symlinks=0; |
101 | my_bool my_disable_copystat_in_redel=0; |
102 | |
103 | /* Typelib by all clients */ |
104 | const char *sql_protocol_names_lib[] = |
105 | { "TCP" , "SOCKET" , "PIPE" , "MEMORY" , NullS }; |
106 | |
107 | TYPELIB sql_protocol_typelib ={ array_elements(sql_protocol_names_lib) - 1, "" , |
108 | sql_protocol_names_lib, NULL }; |
109 | |