520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
5 |
*
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
1
by brian
clean slate |
20 |
|
798.2.28
by Brian Aker
More pulling of code... master_pos function code removed. |
21 |
#include <drizzled/configmake.h> |
243.1.17
by Jay Pipes
FINAL PHASE removal of mysql_priv.h (Bye, bye my friend.) |
22 |
#include <drizzled/server_includes.h> |
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
23 |
#include <drizzled/atomics.h> |
520.6.2
by Monty Taylor
Removed netdb.h from common_includes. Check it out - it was only used in ***2*** files. _Definitely_ a common include. |
24 |
|
25 |
#include <netdb.h> |
|
26 |
#include <sys/poll.h> |
|
27 |
#include <netinet/tcp.h> |
|
520.6.5
by Monty Taylor
Removed signal.h from common_includes. |
28 |
#include <signal.h> |
520.6.2
by Monty Taylor
Removed netdb.h from common_includes. Check it out - it was only used in ***2*** files. _Definitely_ a common include. |
29 |
|
212.5.28
by Monty Taylor
Moved my_bit and my_list |
30 |
#include <mysys/my_bit.h> |
779.3.37
by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes |
31 |
#include <libdrizzleclient/libdrizzle.h> |
614
by Brian Aker
Remove filtering (wrong layer, belongs in plugin). |
32 |
#include <mysys/hash.h> |
520.6.2
by Monty Taylor
Removed netdb.h from common_includes. Check it out - it was only used in ***2*** files. _Definitely_ a common include. |
33 |
#include <drizzled/stacktrace.h> |
212.5.13
by Monty Taylor
Moved my_sys/my_pthread/my_nosys and mysys_err to mysys. |
34 |
#include <mysys/mysys_err.h> |
549
by Monty Taylor
Took gettext.h out of header files. |
35 |
#include <drizzled/error.h> |
722.4.1
by Mark Atwood
integrate errmsg plugin into sql_print_* functions |
36 |
#include <drizzled/errmsg_print.h> |
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
37 |
#include <drizzled/tztime.h> |
575.4.7
by Monty Taylor
More header cleanup. |
38 |
#include <drizzled/sql_base.h> |
39 |
#include <drizzled/show.h> |
|
40 |
#include <drizzled/sql_parse.h> |
|
584.4.7
by Monty Taylor
Removed a big bank of includes from item.h. |
41 |
#include <drizzled/item/cmpfunc.h> |
584.1.15
by Monty Taylor
The mega-patch from hell. Renamed sql_class to session (since that's what it is) and removed it and field and table from common_includes. |
42 |
#include <drizzled/session.h> |
43 |
#include <drizzled/db.h> |
|
44 |
#include <drizzled/item/create.h> |
|
612.1.1
by Mark Atwood
remove some errmsg dead code, use more of the errmsg plugin |
45 |
#include <drizzled/errmsg.h> |
670.2.4
by Monty Taylor
Removed more stuff from the headers. |
46 |
#include <drizzled/unireg.h> |
809
by Brian Aker
Refactor of scheduler plugin code to simplify around one structure. Also |
47 |
#include <drizzled/plugin_scheduling.h> |
813.1.2
by Jay Pipes
First function cleanup for temporal handling: YEAR() |
48 |
#include "drizzled/temporal_format.h" /* For init_temporal_formats() */ |
1
by brian
clean slate |
49 |
|
481.1.15
by Monty Taylor
Removed time.h and sys/time.h from global.h. |
50 |
#if TIME_WITH_SYS_TIME
|
51 |
# include <sys/time.h>
|
|
52 |
# include <time.h>
|
|
53 |
#else
|
|
54 |
# if HAVE_SYS_TIME_H
|
|
55 |
# include <sys/time.h>
|
|
56 |
# else
|
|
57 |
# include <time.h>
|
|
58 |
# endif
|
|
59 |
#endif
|
|
60 |
||
230.1.5
by Monty Taylor
Fixed a quick includes in drizzled.cc. |
61 |
#include <storage/myisam/ha_myisam.h> |
1
by brian
clean slate |
62 |
|
63 |
#ifdef HAVE_SYS_PRCTL_H
|
|
64 |
#include <sys/prctl.h> |
|
65 |
#endif
|
|
66 |
||
779.3.37
by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes |
67 |
#include <libdrizzleclient/errmsg.h> |
202.3.8
by Monty Taylor
Actually turn gettext on... |
68 |
#include <locale.h> |
1
by brian
clean slate |
69 |
|
383.1.6
by Brian Aker
Removed more of the charset support. |
70 |
#define mysqld_charset &my_charset_utf8_general_ci
|
1
by brian
clean slate |
71 |
|
72 |
#ifdef HAVE_purify
|
|
73 |
#define IF_PURIFY(A,B) (A)
|
|
74 |
#else
|
|
75 |
#define IF_PURIFY(A,B) (B)
|
|
76 |
#endif
|
|
77 |
||
481.1.23
by Monty Taylor
Removed custome max size_t with SIZE_MAX |
78 |
#define MAX_MEM_TABLE_SIZE SIZE_MAX
|
1
by brian
clean slate |
79 |
|
80 |
extern "C" { // Because of SCO 3.2V4.2 |
|
81 |
#include <errno.h> |
|
82 |
#include <sys/stat.h> |
|
212.5.21
by Monty Taylor
Moved my_getopt.h |
83 |
#include <mysys/my_getopt.h> |
1
by brian
clean slate |
84 |
#ifdef HAVE_SYSENT_H
|
85 |
#include <sysent.h> |
|
86 |
#endif
|
|
87 |
#ifdef HAVE_PWD_H
|
|
88 |
#include <pwd.h> // For getpwent |
|
89 |
#endif
|
|
90 |
#ifdef HAVE_GRP_H
|
|
91 |
#include <grp.h> |
|
92 |
#endif
|
|
93 |
||
94 |
#include <sys/resource.h> |
|
95 |
||
96 |
#ifdef HAVE_SELECT_H
|
|
97 |
# include <select.h>
|
|
98 |
#endif
|
|
99 |
||
100 |
#ifdef HAVE_SYS_SELECT_H
|
|
101 |
#include <sys/select.h> |
|
102 |
#endif
|
|
103 |
||
104 |
#include <sys/utsname.h> |
|
105 |
||
106 |
#ifdef HAVE_SYS_MMAN_H
|
|
107 |
#include <sys/mman.h> |
|
108 |
#endif
|
|
109 |
||
110 |
#define SIGNAL_FMT "signal %d"
|
|
236.1.40
by Monty Taylor
A few meaningless changes. |
111 |
|
1
by brian
clean slate |
112 |
|
113 |
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
|
|
114 |
#include <ieeefp.h> |
|
115 |
#ifdef HAVE_FP_EXCEPT // Fix type conflict |
|
116 |
typedef fp_except fp_except_t; |
|
117 |
#endif
|
|
118 |
#endif /* __FreeBSD__ && HAVE_IEEEFP_H */ |
|
119 |
||
120 |
#ifdef HAVE_FPU_CONTROL_H
|
|
121 |
#include <fpu_control.h> |
|
122 |
#endif
|
|
123 |
||
124 |
#ifdef HAVE_SYS_FPU_H
|
|
125 |
/* for IRIX to use set_fpc_csr() */
|
|
126 |
#include <sys/fpu.h> |
|
127 |
#endif
|
|
128 |
||
575.4.6
by Monty Taylor
Removed my_getwd. |
129 |
|
1
by brian
clean slate |
130 |
inline void setup_fpu() |
131 |
{
|
|
132 |
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
|
|
133 |
/*
|
|
134 |
We can't handle floating point exceptions with threads, so disable
|
|
135 |
this on freebsd.
|
|
136 |
Don't fall for overflow, underflow,divide-by-zero or loss of precision
|
|
137 |
*/
|
|
138 |
#if defined(__i386__)
|
|
139 |
fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ | |
|
140 |
FP_X_IMP)); |
|
141 |
#else
|
|
142 |
fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ | |
|
143 |
FP_X_IMP)); |
|
144 |
#endif /* __i386__ */ |
|
145 |
#endif /* __FreeBSD__ && HAVE_IEEEFP_H */ |
|
146 |
||
147 |
/*
|
|
148 |
x86 (32-bit) requires FPU precision to be explicitly set to 64 bit for
|
|
149 |
portable results of floating point operations
|
|
150 |
*/
|
|
151 |
#if defined(__i386__) && defined(HAVE_FPU_CONTROL_H) && defined(_FPU_DOUBLE)
|
|
152 |
fpu_control_t cw; |
|
153 |
_FPU_GETCW(cw); |
|
154 |
cw= (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE; |
|
155 |
_FPU_SETCW(cw); |
|
156 |
#endif /* __i386__ && HAVE_FPU_CONTROL_H && _FPU_DOUBLE */ |
|
157 |
}
|
|
158 |
||
159 |
} /* cplusplus */ |
|
160 |
||
212.5.13
by Monty Taylor
Moved my_sys/my_pthread/my_nosys and mysys_err to mysys. |
161 |
#include <mysys/my_pthread.h> // For thr_setconcurency() |
1
by brian
clean slate |
162 |
|
538
by Monty Taylor
Moved gettext.h into drizzled in anticipation of the new client lib. |
163 |
#include <drizzled/gettext.h> |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
164 |
|
1
by brian
clean slate |
165 |
#ifdef SOLARIS
|
166 |
extern "C" int gethostname(char *name, int namelen); |
|
167 |
#endif
|
|
168 |
||
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
169 |
extern "C" void handle_segfault(int sig); |
1
by brian
clean slate |
170 |
|
575.4.6
by Monty Taylor
Removed my_getwd. |
171 |
using namespace std; |
172 |
||
1
by brian
clean slate |
173 |
/* Constants */
|
174 |
||
175 |
const char *show_comp_option_name[]= {"YES", "NO", "DISABLED"}; |
|
176 |
/*
|
|
177 |
WARNING: When adding new SQL modes don't forget to update the
|
|
178 |
tables definitions that stores it's value.
|
|
179 |
(ie: mysql.event, mysql.proc)
|
|
180 |
*/
|
|
181 |
static const char *optimizer_switch_names[]= |
|
182 |
{
|
|
183 |
"no_materialization", "no_semijoin", |
|
461
by Monty Taylor
Removed NullS. bu-bye. |
184 |
NULL
|
1
by brian
clean slate |
185 |
};
|
186 |
||
187 |
/* Corresponding defines are named OPTIMIZER_SWITCH_XXX */
|
|
188 |
static const unsigned int optimizer_switch_names_len[]= |
|
189 |
{
|
|
190 |
/*no_materialization*/ 19, |
|
191 |
/*no_semijoin*/ 11 |
|
192 |
};
|
|
193 |
||
194 |
TYPELIB optimizer_switch_typelib= { array_elements(optimizer_switch_names)-1,"", |
|
195 |
optimizer_switch_names, |
|
196 |
(unsigned int *)optimizer_switch_names_len }; |
|
197 |
||
198 |
static const char *tc_heuristic_recover_names[]= |
|
199 |
{
|
|
461
by Monty Taylor
Removed NullS. bu-bye. |
200 |
"COMMIT", "ROLLBACK", NULL |
1
by brian
clean slate |
201 |
};
|
202 |
static TYPELIB tc_heuristic_recover_typelib= |
|
203 |
{
|
|
204 |
array_elements(tc_heuristic_recover_names)-1,"", |
|
205 |
tc_heuristic_recover_names, NULL |
|
206 |
};
|
|
207 |
||
208 |
const char *first_keyword= "first", *binary_keyword= "BINARY"; |
|
209 |
const char *my_localhost= "localhost"; |
|
722.1.3
by Monty Taylor
Cleaned up a few build things. |
210 |
const char * const DRIZZLE_CONFIG_NAME= "drizzled"; |
1
by brian
clean slate |
211 |
#define GET_HA_ROWS GET_ULL
|
212 |
||
213 |
/*
|
|
214 |
Used with --help for detailed option
|
|
215 |
*/
|
|
259
by Brian Aker
First pass on PAM auth |
216 |
static bool opt_help= false; |
1
by brian
clean slate |
217 |
|
218 |
arg_cmp_func Arg_comparator::comparator_matrix[5][2] = |
|
219 |
{{&Arg_comparator::compare_string, &Arg_comparator::compare_e_string}, |
|
220 |
{&Arg_comparator::compare_real, &Arg_comparator::compare_e_real}, |
|
221 |
{&Arg_comparator::compare_int_signed, &Arg_comparator::compare_e_int}, |
|
222 |
{&Arg_comparator::compare_row, &Arg_comparator::compare_e_row}, |
|
223 |
{&Arg_comparator::compare_decimal, &Arg_comparator::compare_e_decimal}}; |
|
224 |
||
225 |
/* static variables */
|
|
226 |
||
227 |
/* the default log output is log tables */
|
|
900
by Brian Aker
Creating signal handler plugin. |
228 |
static bool volatile select_thread_in_use; |
1
by brian
clean slate |
229 |
static bool volatile ready_to_exit; |
722.4.1
by Mark Atwood
integrate errmsg plugin into sql_print_* functions |
230 |
static bool opt_debugging= 0; |
566
by Brian Aker
Clean up dead thead code. |
231 |
static uint32_t wake_thread; |
366
by Patrick Galbraith
Ulong conversion |
232 |
static uint32_t killed_threads, thread_created; |
722.4.1
by Mark Atwood
integrate errmsg plugin into sql_print_* functions |
233 |
static char *drizzled_user, *drizzled_chroot; |
798.2.32
by Brian Aker
Last removal of variables. |
234 |
static char *language_ptr, *opt_init_connect; |
1
by brian
clean slate |
235 |
static char *default_character_set_name; |
236 |
static char *character_set_filesystem_name; |
|
237 |
static char *lc_time_names_name; |
|
238 |
static char *my_bind_addr_str; |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
239 |
static char *default_collation_name; |
1
by brian
clean slate |
240 |
static char *default_storage_engine_str; |
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
241 |
static char compiled_default_collation_name[]= DRIZZLE_DEFAULT_COLLATION_NAME; |
855
by Brian Aker
Refactor reset of status. |
242 |
static struct pollfd fds[UINT8_MAX]; |
243 |
static uint8_t pollfd_count= 0; |
|
1
by brian
clean slate |
244 |
|
245 |
/* Global variables */
|
|
246 |
||
92
by Brian Aker
Removed opt_update_log |
247 |
bool opt_bin_log; |
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
248 |
bool opt_skip_show_db= false; |
1
by brian
clean slate |
249 |
bool server_id_supplied = 0; |
250 |
bool opt_endinfo, using_udf_functions; |
|
150
by Brian Aker
More bool removal. More cow bell! |
251 |
bool locked_in_memory; |
604
by Brian Aker
Remove lock condition needed (we do row based replication, so... lock is |
252 |
bool opt_using_transactions; |
1
by brian
clean slate |
253 |
bool volatile abort_loop; |
254 |
bool volatile shutdown_in_progress; |
|
147
by Brian Aker
More my_bool conversion. This time the set_var class. |
255 |
bool opt_local_infile; |
855
by Brian Aker
Refactor reset of status. |
256 |
uint32_t max_used_connections; |
929.1.7
by Brian Aker
Final touch (move multi as default) |
257 |
const char *opt_scheduler= "multi_thread"; |
1
by brian
clean slate |
258 |
|
629.2.7
by Monty Taylor
Fixed a couple of memory buffer size issues. |
259 |
size_t my_thread_stack_size= 65536; |
260 |
||
1
by brian
clean slate |
261 |
/*
|
262 |
Legacy global handlerton. These will be removed (please do not add more).
|
|
263 |
*/
|
|
264 |
handlerton *heap_hton; |
|
265 |
handlerton *myisam_hton; |
|
266 |
||
150
by Brian Aker
More bool removal. More cow bell! |
267 |
bool use_temp_pool; |
1
by brian
clean slate |
268 |
char* opt_secure_file_priv= 0; |
269 |
/*
|
|
270 |
True if there is at least one per-hour limit for some user, so we should
|
|
271 |
check them before each query (and possibly reset counters when hour is
|
|
272 |
changed). False otherwise.
|
|
273 |
*/
|
|
150
by Brian Aker
More bool removal. More cow bell! |
274 |
bool opt_noacl; |
1
by brian
clean slate |
275 |
|
276 |
#ifdef HAVE_INITGROUPS
|
|
163
by Brian Aker
Merge Monty's code. |
277 |
static bool calling_initgroups= false; /**< Used in SIGSEGV handler. */ |
1
by brian
clean slate |
278 |
#endif
|
574.2.1
by ysano
Rename mysql to drizzle. |
279 |
uint32_t drizzled_port, test_flags, select_errors, dropping_tables, ha_open_options; |
280 |
uint32_t drizzled_port_timeout; |
|
722.1.3
by Monty Taylor
Cleaned up a few build things. |
281 |
uint32_t delay_key_write_options, protocol_version= PROTOCOL_VERSION; |
482
by Brian Aker
Remove uint. |
282 |
uint32_t lower_case_table_names= 1; |
283 |
uint32_t tc_heuristic_recover= 0; |
|
929.1.1
by Brian Aker
Push thread count out to the scheduler. |
284 |
uint32_t volatile thread_running; |
520.1.22
by Brian Aker
Second pass of thd cleanup |
285 |
uint64_t session_startup_options; |
626
by Brian Aker
More of the same (ulong/64) |
286 |
uint32_t back_log; |
892.2.2
by Monty Taylor
More solaris warnings. |
287 |
uint32_t connect_timeout; |
520.4.14
by Monty Taylor
Removed korr.h and tztime.h from common_includes. Also removed the HAVE_DTRACE block and stuck it in autoconf. |
288 |
uint32_t server_id; |
622.1.1
by Brian Aker
32bit fixes around vars |
289 |
uint64_t table_cache_size; |
290 |
uint64_t table_def_size; |
|
291 |
uint64_t slow_launch_time; |
|
625
by Brian Aker
ulong/64 bit straighten out. |
292 |
uint64_t slave_open_temp_tables; |
366
by Patrick Galbraith
Ulong conversion |
293 |
uint32_t refresh_version; /* Increments on each reload */ |
625
by Brian Aker
ulong/64 bit straighten out. |
294 |
uint64_t aborted_threads; |
295 |
uint64_t aborted_connects; |
|
622.1.1
by Brian Aker
32bit fixes around vars |
296 |
uint64_t max_connect_errors; |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
297 |
uint32_t thread_id=1L; |
606
by Brian Aker
Remove dead lex structure and clean up use of pid_t |
298 |
pid_t current_pid; |
625
by Brian Aker
ulong/64 bit straighten out. |
299 |
uint64_t slow_launch_threads= 0; |
1
by brian
clean slate |
300 |
|
301 |
const double log_10[] = { |
|
302 |
1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, |
|
303 |
1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019, |
|
304 |
1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029, |
|
305 |
1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039, |
|
306 |
1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049, |
|
307 |
1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059, |
|
308 |
1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069, |
|
309 |
1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079, |
|
310 |
1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089, |
|
311 |
1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099, |
|
312 |
1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109, |
|
313 |
1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119, |
|
314 |
1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129, |
|
315 |
1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139, |
|
316 |
1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149, |
|
317 |
1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, |
|
318 |
1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169, |
|
319 |
1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179, |
|
320 |
1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189, |
|
321 |
1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199, |
|
322 |
1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209, |
|
323 |
1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219, |
|
324 |
1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229, |
|
325 |
1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239, |
|
326 |
1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249, |
|
327 |
1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259, |
|
328 |
1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269, |
|
329 |
1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279, |
|
330 |
1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289, |
|
331 |
1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299, |
|
332 |
1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308 |
|
333 |
};
|
|
334 |
||
855
by Brian Aker
Refactor reset of status. |
335 |
time_t server_start_time; |
336 |
time_t flush_status_time; |
|
1
by brian
clean slate |
337 |
|
909
by Brian Aker
Remove the need for unireg init |
338 |
/* FRM Junk */
|
339 |
const char *reg_ext= ".frm"; |
|
340 |
uint32_t reg_ext_length= 4; |
|
341 |
||
575.4.1
by ysano
Rename mysql to drizzle. |
342 |
char drizzle_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; |
1
by brian
clean slate |
343 |
char *default_tz_name; |
722.4.1
by Mark Atwood
integrate errmsg plugin into sql_print_* functions |
344 |
char glob_hostname[FN_REFLEN]; |
575.4.1
by ysano
Rename mysql to drizzle. |
345 |
char drizzle_real_data_home[FN_REFLEN], |
856
by Brian Aker
Remove dead code around charset variable/directory. |
346 |
language[FN_REFLEN], |
347 |
*opt_init_file, |
|
348 |
*opt_tc_log_file; |
|
575.4.1
by ysano
Rename mysql to drizzle. |
349 |
char drizzle_unpacked_real_data_home[FN_REFLEN]; |
1
by brian
clean slate |
350 |
const key_map key_map_empty(0); |
351 |
key_map key_map_full(0); // Will be initialized later |
|
352 |
||
575.4.1
by ysano
Rename mysql to drizzle. |
353 |
uint32_t drizzle_data_home_len; |
575.4.3
by ysano
Rename mysql to drizzle. |
354 |
char drizzle_data_home_buff[2], *drizzle_data_home=drizzle_real_data_home; |
1
by brian
clean slate |
355 |
char server_version[SERVER_VERSION_LENGTH]; |
680
by Brian Aker
Remove locks around temp tables for searching tmp directory path. |
356 |
char *drizzle_tmpdir= NULL; |
357 |
char *opt_drizzle_tmpdir= NULL; |
|
1
by brian
clean slate |
358 |
const char *myisam_recover_options_str="OFF"; |
359 |
const char *myisam_stats_method_str="nulls_unequal"; |
|
360 |
||
361 |
/** name of reference on left espression in rewritten IN subquery */
|
|
362 |
const char *in_left_expr_name= "<left expr>"; |
|
363 |
/** name of additional condition */
|
|
364 |
const char *in_additional_cond= "<IN COND>"; |
|
365 |
const char *in_having_cond= "<IN HAVING>"; |
|
366 |
||
367 |
my_decimal decimal_zero; |
|
368 |
/* classes for comparation parsing/processing */
|
|
369 |
||
370 |
FILE *stderror_file=0; |
|
371 |
||
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
372 |
I_List<Session> session_list; |
1
by brian
clean slate |
373 |
I_List<NAMED_LIST> key_caches; |
374 |
||
375 |
struct system_variables global_system_variables; |
|
376 |
struct system_variables max_system_variables; |
|
377 |
struct system_status_var global_status_var; |
|
378 |
||
379 |
MY_BITMAP temp_pool; |
|
380 |
||
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
381 |
const CHARSET_INFO *system_charset_info, *files_charset_info ; |
942.2.1
by Brian Aker
Dead option |
382 |
const CHARSET_INFO *table_alias_charset; |
264.2.6
by Andrey Hristov
Constify the usage of CHARSET_INFO almost to the last place in the code. |
383 |
const CHARSET_INFO *character_set_filesystem; |
1
by brian
clean slate |
384 |
|
385 |
MY_LOCALE *my_default_lc_time_names; |
|
386 |
||
177.3.1
by mark
remove ifdef HAVE_DLOPEN, make configure require dlopen() |
387 |
SHOW_COMP_OPTION have_symlink; |
1
by brian
clean slate |
388 |
|
389 |
/* Thread specific variables */
|
|
390 |
||
670.2.1
by Monty Taylor
Moved pthread keys |
391 |
pthread_key_t THR_Mem_root; |
520.6.7
by Monty Taylor
Moved a bunch of crap out of common_includes. |
392 |
pthread_key_t THR_Session; |
840.1.21
by Monty Taylor
ZOMG. Renamed all the rest of the stuff in libdrizzleclient to be drizzleclient_*. I love commandline perl. |
393 |
pthread_mutex_t LOCK_drizzleclient_create_db, |
808
by Brian Aker
Move number of threads to use for pool of threads to module. Removed slave |
394 |
LOCK_open, |
395 |
LOCK_thread_count, |
|
566
by Brian Aker
Clean up dead thead code. |
396 |
LOCK_status, |
397 |
LOCK_global_read_lock, |
|
854
by Brian Aker
Removed double lock usage. |
398 |
LOCK_global_system_variables; |
1
by brian
clean slate |
399 |
|
658
by Brian Aker
Part removal of my_pthread.h |
400 |
pthread_rwlock_t LOCK_sys_init_connect; |
401 |
pthread_rwlock_t LOCK_system_variables_hash; |
|
1
by brian
clean slate |
402 |
pthread_cond_t COND_refresh, COND_thread_count, COND_global_read_lock; |
403 |
pthread_t signal_thread; |
|
404 |
pthread_cond_t COND_server_started; |
|
405 |
||
406 |
/* replication parameters, if master_host is not NULL, we are a slave */
|
|
482
by Brian Aker
Remove uint. |
407 |
uint32_t report_port= DRIZZLE_PORT; |
130
by Brian Aker
ulong cleanup |
408 |
uint32_t master_retry_count= 0; |
1
by brian
clean slate |
409 |
char *master_info_file; |
571
by Brian Aker
Removed random dead code left over from previous scheduler (plus the... has |
410 |
char *report_host; |
438.1.1
by Brian Aker
First pass of removing historical logging. |
411 |
char *opt_logname; |
1
by brian
clean slate |
412 |
|
413 |
/* Static variables */
|
|
414 |
||
900
by Brian Aker
Creating signal handler plugin. |
415 |
static bool segfaulted; |
1
by brian
clean slate |
416 |
#ifdef HAVE_STACK_TRACE_ON_SEGV
|
150
by Brian Aker
More bool removal. More cow bell! |
417 |
static bool opt_do_pstack; |
1
by brian
clean slate |
418 |
#endif /* HAVE_STACK_TRACE_ON_SEGV */ |
900
by Brian Aker
Creating signal handler plugin. |
419 |
int cleanup_done; |
574.2.1
by ysano
Rename mysql to drizzle. |
420 |
static char *drizzle_home_ptr, *pidfile_name_ptr; |
1
by brian
clean slate |
421 |
static int defaults_argc; |
422 |
static char **defaults_argv; |
|
423 |
static char *opt_bin_logname; |
|
424 |
||
520.1.21
by Brian Aker
THD -> Session rename |
425 |
struct rand_struct sql_rand; ///< used by sql_class.cc:Session::Session() |
1
by brian
clean slate |
426 |
|
427 |
struct passwd *user_info; |
|
428 |
static pthread_t select_thread; |
|
482
by Brian Aker
Remove uint. |
429 |
static uint32_t thr_kill_signal; |
1
by brian
clean slate |
430 |
|
809
by Brian Aker
Refactor of scheduler plugin code to simplify around one structure. Also |
431 |
extern scheduling_st thread_scheduler; |
1
by brian
clean slate |
432 |
|
433 |
/**
|
|
434 |
Number of currently active user connections. The variable is protected by
|
|
854
by Brian Aker
Removed double lock usage. |
435 |
LOCK_thread_count.
|
1
by brian
clean slate |
436 |
*/
|
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
437 |
tbb::atomic<uint32_t> connection_count; |
1
by brian
clean slate |
438 |
|
439 |
/* Function declarations */
|
|
440 |
||
779.3.23
by Monty Taylor
More fixy-fixes. |
441 |
extern "C" pthread_handler_t signal_hand(void *arg); |
574.2.1
by ysano
Rename mysql to drizzle. |
442 |
static void drizzle_init_variables(void); |
1
by brian
clean slate |
443 |
static void get_options(int *argc,char **argv); |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
444 |
extern "C" bool drizzled_get_one_option(int, const struct my_option *, char *); |
1
by brian
clean slate |
445 |
static void set_server_version(void); |
446 |
static int init_thread_environment(); |
|
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
447 |
static const char *get_relative_path(const char *path); |
1
by brian
clean slate |
448 |
static void fix_paths(void); |
11
by Brian Aker
Removing old UNIX socket bits |
449 |
void handle_connections_sockets(); |
779.3.23
by Monty Taylor
More fixy-fixes. |
450 |
extern "C" pthread_handler_t handle_slave(void *arg); |
366
by Patrick Galbraith
Ulong conversion |
451 |
static uint32_t find_bit_type(const char *x, TYPELIB *bit_lib); |
452 |
static uint32_t find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, |
|
1
by brian
clean slate |
453 |
const char *option); |
454 |
static void clean_up(bool print_message); |
|
455 |
||
456 |
static void usage(void); |
|
457 |
static void clean_up_mutexes(void); |
|
779.3.23
by Monty Taylor
More fixy-fixes. |
458 |
extern "C" bool safe_read_error_impl(NET *net); |
1
by brian
clean slate |
459 |
|
460 |
/****************************************************************************
|
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
461 |
** Code to end drizzled
|
1
by brian
clean slate |
462 |
****************************************************************************/
|
463 |
||
900
by Brian Aker
Creating signal handler plugin. |
464 |
void close_connections(void) |
1
by brian
clean slate |
465 |
{
|
907
by Brian Aker
Shutdown for Linux fixed. |
466 |
int x; |
467 |
||
468 |
/* Abort listening to new connections */
|
|
469 |
for (x= 0; x < pollfd_count; x++) |
|
470 |
{
|
|
471 |
if (fds[x].fd != -1) |
|
472 |
{
|
|
473 |
(void) shutdown(fds[x].fd, SHUT_RDWR); |
|
474 |
(void) close(fds[x].fd); |
|
475 |
fds[x].fd= -1; |
|
476 |
}
|
|
477 |
}
|
|
478 |
||
1
by brian
clean slate |
479 |
|
480 |
/* kill connection thread */
|
|
481 |
(void) pthread_mutex_lock(&LOCK_thread_count); |
|
482 |
||
483 |
while (select_thread_in_use) |
|
484 |
{
|
|
485 |
struct timespec abstime; |
|
486 |
int error; |
|
487 |
||
488 |
set_timespec(abstime, 2); |
|
482
by Brian Aker
Remove uint. |
489 |
for (uint32_t tmp=0 ; tmp < 10 && select_thread_in_use; tmp++) |
1
by brian
clean slate |
490 |
{
|
907
by Brian Aker
Shutdown for Linux fixed. |
491 |
error=pthread_cond_timedwait(&COND_thread_count,&LOCK_thread_count, &abstime); |
1
by brian
clean slate |
492 |
if (error != EINTR) |
907
by Brian Aker
Shutdown for Linux fixed. |
493 |
break; |
1
by brian
clean slate |
494 |
}
|
495 |
}
|
|
496 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
497 |
||
498 |
||
499 |
/*
|
|
500 |
First signal all threads that it's time to die
|
|
501 |
This will give the threads some time to gracefully abort their
|
|
502 |
statements and inform their clients that the server is about to die.
|
|
503 |
*/
|
|
504 |
||
520.1.21
by Brian Aker
THD -> Session rename |
505 |
Session *tmp; |
1
by brian
clean slate |
506 |
(void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list |
507 |
||
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
508 |
I_List_iterator<Session> it(session_list); |
509 |
while ((tmp=it++)) |
|
1
by brian
clean slate |
510 |
{
|
520.1.21
by Brian Aker
THD -> Session rename |
511 |
tmp->killed= Session::KILL_CONNECTION; |
1
by brian
clean slate |
512 |
thread_scheduler.post_kill_notification(tmp); |
513 |
if (tmp->mysys_var) |
|
514 |
{
|
|
515 |
tmp->mysys_var->abort=1; |
|
516 |
pthread_mutex_lock(&tmp->mysys_var->mutex); |
|
517 |
if (tmp->mysys_var->current_cond) |
|
518 |
{
|
|
566
by Brian Aker
Clean up dead thead code. |
519 |
pthread_mutex_lock(tmp->mysys_var->current_mutex); |
520 |
pthread_cond_broadcast(tmp->mysys_var->current_cond); |
|
521 |
pthread_mutex_unlock(tmp->mysys_var->current_mutex); |
|
1
by brian
clean slate |
522 |
}
|
523 |
pthread_mutex_unlock(&tmp->mysys_var->mutex); |
|
524 |
}
|
|
525 |
}
|
|
526 |
(void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list |
|
527 |
||
948
by Brian Aker
Restoring code Monty deleted. |
528 |
if (connection_count) |
529 |
sleep(2); // Give threads time to die |
|
530 |
||
1
by brian
clean slate |
531 |
/*
|
532 |
Force remaining threads to die by closing the connection to the client
|
|
533 |
This will ensure that threads that are waiting for a command from the
|
|
534 |
client on a blocking read call are aborted.
|
|
535 |
*/
|
|
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
536 |
for (;;) |
1
by brian
clean slate |
537 |
{
|
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
538 |
(void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list |
539 |
if (!(tmp= session_list.get())) |
|
1
by brian
clean slate |
540 |
{
|
541 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
542 |
break; |
|
543 |
}
|
|
544 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
942.1.2
by Monty Taylor
Started trying to sort out session lifecycle. |
545 |
unlink_session(tmp); |
1
by brian
clean slate |
546 |
}
|
949
by Brian Aker
Adding assert for session_list to be empty |
547 |
assert(session_list.is_empty()); |
1
by brian
clean slate |
548 |
}
|
549 |
||
550 |
||
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
551 |
extern "C" void print_signal_warning(int sig) |
1
by brian
clean slate |
552 |
{
|
553 |
if (global_system_variables.log_warnings) |
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
554 |
errmsg_printf(ERRMSG_LVL_WARN, _("Got signal %d from thread %"PRIu64), sig,my_thread_id()); |
447
by Monty Taylor
Removed DONT_REMEMBER_SIGNAL define. |
555 |
#ifndef HAVE_BSD_SIGNALS
|
1
by brian
clean slate |
556 |
my_sigset(sig,print_signal_warning); /* int. thread system calls */ |
557 |
#endif
|
|
558 |
if (sig == SIGALRM) |
|
559 |
alarm(2); /* reschedule alarm */ |
|
560 |
}
|
|
561 |
||
562 |
/**
|
|
563 |
cleanup all memory and end program nicely.
|
|
564 |
||
565 |
If SIGNALS_DONT_BREAK_READ is defined, this function is called
|
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
566 |
by the main thread. To get Drizzle to shut down nicely in this case
|
1
by brian
clean slate |
567 |
(Mac OS X) we have to call exit() instead if pthread_exit().
|
568 |
||
569 |
@note
|
|
570 |
This function never returns.
|
|
571 |
*/
|
|
900
by Brian Aker
Creating signal handler plugin. |
572 |
extern "C" void unireg_end(void) |
1
by brian
clean slate |
573 |
{
|
574 |
clean_up(1); |
|
575 |
my_thread_end(); |
|
576 |
#if defined(SIGNALS_DONT_BREAK_READ)
|
|
577 |
exit(0); |
|
578 |
#else
|
|
579 |
pthread_exit(0); // Exit is in main thread |
|
580 |
#endif
|
|
581 |
}
|
|
582 |
||
583 |
||
584 |
extern "C" void unireg_abort(int exit_code) |
|
585 |
{
|
|
586 |
||
587 |
if (exit_code) |
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
588 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Aborting\n")); |
1
by brian
clean slate |
589 |
else if (opt_help) |
590 |
usage(); |
|
228
by Brian Aker
First pass on socket cleanup. |
591 |
clean_up(!opt_help && (exit_code)); /* purecov: inspected */ |
1
by brian
clean slate |
592 |
clean_up_mutexes(); |
593 |
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); |
|
594 |
exit(exit_code); /* purecov: inspected */ |
|
595 |
}
|
|
596 |
||
597 |
||
909
by Brian Aker
Remove the need for unireg init |
598 |
static void clean_up(bool print_message) |
1
by brian
clean slate |
599 |
{
|
600 |
if (cleanup_done++) |
|
601 |
return; /* purecov: inspected */ |
|
602 |
||
603 |
table_cache_free(); |
|
604 |
table_def_free(); |
|
605 |
set_var_free(); |
|
606 |
free_charsets(); |
|
607 |
udf_free(); |
|
608 |
plugin_shutdown(); |
|
609 |
ha_end(); |
|
610 |
xid_cache_free(); |
|
481
by Brian Aker
Remove all of uchar. |
611 |
delete_elements(&key_caches, (void (*)(const char*, unsigned char*)) free_key_cache); |
1
by brian
clean slate |
612 |
multi_keycache_free(); |
613 |
free_status_vars(); |
|
614 |
my_free_open_file_info(); |
|
615 |
if (defaults_argv) |
|
616 |
free_defaults(defaults_argv); |
|
477
by Monty Taylor
Removed my_free(). It turns out that it had been def'd to ignore the flags passed to it in the second arg anyway. Gotta love that. |
617 |
free(sys_init_connect.value); |
680
by Brian Aker
Remove locks around temp tables for searching tmp directory path. |
618 |
free(drizzle_tmpdir); |
460
by Monty Taylor
Removed x_free calls. |
619 |
if (opt_bin_logname) |
620 |
free(opt_bin_logname); |
|
621 |
if (opt_secure_file_priv) |
|
622 |
free(opt_secure_file_priv); |
|
1
by brian
clean slate |
623 |
bitmap_free(&temp_pool); |
624 |
||
914.2.1
by Brian Aker
Cleanup pid handler. |
625 |
(void) unlink(pidfile_name); // This may not always exist |
228
by Brian Aker
First pass on socket cleanup. |
626 |
|
202.3.6
by Monty Taylor
First pass at gettexizing the error messages. |
627 |
if (print_message && server_start_time) |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
628 |
errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_SHUTDOWN_COMPLETE)),my_progname); |
202.3.7
by Monty Taylor
Gettext error compiles and passes test! |
629 |
/* Returns NULL on globerrs, we don't want to try to free that */
|
630 |
//void *freeme=
|
|
631 |
(void *)my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST); |
|
632 |
// TODO!!!! EPIC FAIL!!!! This sefaults if uncommented.
|
|
633 |
/* if (freeme != NULL)
|
|
477
by Monty Taylor
Removed my_free(). It turns out that it had been def'd to ignore the flags passed to it in the second arg anyway. Gotta love that. |
634 |
free(freeme); */
|
1
by brian
clean slate |
635 |
(void) pthread_mutex_lock(&LOCK_thread_count); |
636 |
ready_to_exit=1; |
|
637 |
/* do the broadcast inside the lock to ensure that my_end() is not called */
|
|
638 |
(void) pthread_cond_broadcast(&COND_thread_count); |
|
639 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
640 |
||
641 |
/*
|
|
642 |
The following lines may never be executed as the main thread may have
|
|
643 |
killed us
|
|
644 |
*/
|
|
645 |
} /* clean_up */ |
|
646 |
||
647 |
||
648 |
static void clean_up_mutexes() |
|
649 |
{
|
|
840.1.21
by Monty Taylor
ZOMG. Renamed all the rest of the stuff in libdrizzleclient to be drizzleclient_*. I love commandline perl. |
650 |
(void) pthread_mutex_destroy(&LOCK_drizzleclient_create_db); |
1
by brian
clean slate |
651 |
(void) pthread_mutex_destroy(&LOCK_lock_db); |
652 |
(void) pthread_mutex_destroy(&LOCK_open); |
|
653 |
(void) pthread_mutex_destroy(&LOCK_thread_count); |
|
654 |
(void) pthread_mutex_destroy(&LOCK_status); |
|
658
by Brian Aker
Part removal of my_pthread.h |
655 |
(void) pthread_rwlock_destroy(&LOCK_sys_init_connect); |
1
by brian
clean slate |
656 |
(void) pthread_mutex_destroy(&LOCK_global_system_variables); |
658
by Brian Aker
Part removal of my_pthread.h |
657 |
(void) pthread_rwlock_destroy(&LOCK_system_variables_hash); |
1
by brian
clean slate |
658 |
(void) pthread_mutex_destroy(&LOCK_global_read_lock); |
659 |
(void) pthread_cond_destroy(&COND_thread_count); |
|
660 |
(void) pthread_cond_destroy(&COND_refresh); |
|
661 |
(void) pthread_cond_destroy(&COND_global_read_lock); |
|
662 |
}
|
|
663 |
||
664 |
||
665 |
/****************************************************************************
|
|
666 |
** Init IP and UNIX socket
|
|
667 |
****************************************************************************/
|
|
668 |
||
669 |
static void set_ports() |
|
670 |
{
|
|
671 |
char *env; |
|
574.2.1
by ysano
Rename mysql to drizzle. |
672 |
if (!drizzled_port) |
1
by brian
clean slate |
673 |
{ // Get port if not from commandline |
574.2.1
by ysano
Rename mysql to drizzle. |
674 |
drizzled_port= DRIZZLE_PORT; |
1
by brian
clean slate |
675 |
|
676 |
/*
|
|
677 |
if builder specifically requested a default port, use that
|
|
678 |
(even if it coincides with our factory default).
|
|
679 |
only if they didn't do we check /etc/services (and, failing
|
|
165.1.1
by Elliot Murphy
new port number from IANA |
680 |
on that, fall back to the factory default of 4427).
|
1
by brian
clean slate |
681 |
either default can be overridden by the environment variable
|
301
by Brian Aker
Clean up port startup |
682 |
DRIZZLE_TCP_PORT, which in turn can be overridden with command
|
1
by brian
clean slate |
683 |
line options.
|
684 |
*/
|
|
685 |
||
686 |
struct servent *serv_ptr; |
|
301
by Brian Aker
Clean up port startup |
687 |
if ((serv_ptr= getservbyname("drizzle", "tcp"))) |
574.2.1
by ysano
Rename mysql to drizzle. |
688 |
drizzled_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */ |
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
689 |
|
301
by Brian Aker
Clean up port startup |
690 |
if ((env = getenv("DRIZZLE_TCP_PORT"))) |
895
by Brian Aker
Completion (?) of uint conversion. |
691 |
drizzled_port= (uint32_t) atoi(env); /* purecov: inspected */ |
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
692 |
|
574.2.1
by ysano
Rename mysql to drizzle. |
693 |
assert(drizzled_port); |
1
by brian
clean slate |
694 |
}
|
695 |
}
|
|
696 |
||
697 |
/* Change to run as another user if started with --user */
|
|
698 |
||
699 |
static struct passwd *check_user(const char *user) |
|
700 |
{
|
|
701 |
struct passwd *tmp_user_info; |
|
702 |
uid_t user_id= geteuid(); |
|
703 |
||
704 |
// Don't bother if we aren't superuser
|
|
705 |
if (user_id) |
|
706 |
{
|
|
707 |
if (user) |
|
708 |
{
|
|
709 |
/* Don't give a warning, if real user is same as given with --user */
|
|
710 |
/* purecov: begin tested */
|
|
711 |
tmp_user_info= getpwnam(user); |
|
712 |
if ((!tmp_user_info || user_id != tmp_user_info->pw_uid) && |
|
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
713 |
global_system_variables.log_warnings) |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
714 |
errmsg_printf(ERRMSG_LVL_WARN, _("One can only use the --user switch " |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
715 |
"if running as root\n")); |
1
by brian
clean slate |
716 |
/* purecov: end */
|
717 |
}
|
|
718 |
return NULL; |
|
719 |
}
|
|
720 |
if (!user) |
|
721 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
722 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Fatal error: Please read \"Security\" section of " |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
723 |
"the manual to find out how to run drizzled as root!\n")); |
228
by Brian Aker
First pass on socket cleanup. |
724 |
unireg_abort(1); |
1
by brian
clean slate |
725 |
}
|
726 |
/* purecov: begin tested */
|
|
727 |
if (!strcmp(user,"root")) |
|
728 |
return NULL; // Avoid problem with dynamic libraries |
|
729 |
||
730 |
if (!(tmp_user_info= getpwnam(user))) |
|
731 |
{
|
|
732 |
// Allow a numeric uid to be used
|
|
733 |
const char *pos; |
|
734 |
for (pos= user; my_isdigit(mysqld_charset,*pos); pos++) ; |
|
735 |
if (*pos) // Not numeric id |
|
736 |
goto err; |
|
737 |
if (!(tmp_user_info= getpwuid(atoi(user)))) |
|
738 |
goto err; |
|
739 |
}
|
|
740 |
return tmp_user_info; |
|
741 |
/* purecov: end */
|
|
742 |
||
743 |
err: |
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
744 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Fatal error: Can't change to run as user '%s' ; " |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
745 |
"Please check that the user exists!\n"),user); |
1
by brian
clean slate |
746 |
unireg_abort(1); |
747 |
||
748 |
#ifdef PR_SET_DUMPABLE
|
|
749 |
if (test_flags & TEST_CORE_ON_SIGNAL) |
|
750 |
{
|
|
751 |
/* inform kernel that process is dumpable */
|
|
752 |
(void) prctl(PR_SET_DUMPABLE, 1); |
|
753 |
}
|
|
754 |
#endif
|
|
755 |
||
908.1.13
by Monty Taylor
Fix for Sun Studio 5.10. |
756 |
/* Sun Studio 5.10 doesn't like this line. 5.9 requires it */
|
908.1.14
by Monty Taylor
I never learn. |
757 |
#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x590)
|
908.1.12
by Monty Taylor
mmm. |
758 |
return NULL; |
908.1.13
by Monty Taylor
Fix for Sun Studio 5.10. |
759 |
#endif
|
908.1.12
by Monty Taylor
mmm. |
760 |
|
1
by brian
clean slate |
761 |
}
|
762 |
||
763 |
static void set_user(const char *user, struct passwd *user_info_arg) |
|
764 |
{
|
|
765 |
/* purecov: begin tested */
|
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
766 |
assert(user_info_arg != 0); |
1
by brian
clean slate |
767 |
#ifdef HAVE_INITGROUPS
|
768 |
/*
|
|
769 |
We can get a SIGSEGV when calling initgroups() on some systems when NSS
|
|
770 |
is configured to use LDAP and the server is statically linked. We set
|
|
771 |
calling_initgroups as a flag to the SIGSEGV handler that is then used to
|
|
772 |
output a specific message to help the user resolve this problem.
|
|
773 |
*/
|
|
163
by Brian Aker
Merge Monty's code. |
774 |
calling_initgroups= true; |
1
by brian
clean slate |
775 |
initgroups((char*) user, user_info_arg->pw_gid); |
163
by Brian Aker
Merge Monty's code. |
776 |
calling_initgroups= false; |
1
by brian
clean slate |
777 |
#endif
|
778 |
if (setgid(user_info_arg->pw_gid) == -1) |
|
779 |
{
|
|
780 |
sql_perror("setgid"); |
|
781 |
unireg_abort(1); |
|
782 |
}
|
|
783 |
if (setuid(user_info_arg->pw_uid) == -1) |
|
784 |
{
|
|
785 |
sql_perror("setuid"); |
|
786 |
unireg_abort(1); |
|
787 |
}
|
|
788 |
/* purecov: end */
|
|
789 |
}
|
|
790 |
||
791 |
||
792 |
static void set_effective_user(struct passwd *user_info_arg) |
|
793 |
{
|
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
794 |
assert(user_info_arg != 0); |
1
by brian
clean slate |
795 |
if (setregid((gid_t)-1, user_info_arg->pw_gid) == -1) |
796 |
{
|
|
797 |
sql_perror("setregid"); |
|
798 |
unireg_abort(1); |
|
799 |
}
|
|
800 |
if (setreuid((uid_t)-1, user_info_arg->pw_uid) == -1) |
|
801 |
{
|
|
802 |
sql_perror("setreuid"); |
|
803 |
unireg_abort(1); |
|
804 |
}
|
|
805 |
}
|
|
806 |
||
807 |
||
808 |
/** Change root user if started with @c --chroot . */
|
|
809 |
static void set_root(const char *path) |
|
810 |
{
|
|
575.4.6
by Monty Taylor
Removed my_getwd. |
811 |
if ((chroot(path) == -1) || !chdir("/")) |
1
by brian
clean slate |
812 |
{
|
813 |
sql_perror("chroot"); |
|
814 |
unireg_abort(1); |
|
815 |
}
|
|
816 |
}
|
|
817 |
||
818 |
||
819 |
static void network_init(void) |
|
820 |
{
|
|
821 |
int ret; |
|
482
by Brian Aker
Remove uint. |
822 |
uint32_t waited; |
823 |
uint32_t this_wait; |
|
824 |
uint32_t retry; |
|
1
by brian
clean slate |
825 |
char port_buf[NI_MAXSERV]; |
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
826 |
struct addrinfo *ai; |
827 |
struct addrinfo *next; |
|
828 |
struct addrinfo hints; |
|
829 |
int error; |
|
1
by brian
clean slate |
830 |
|
831 |
set_ports(); |
|
832 |
||
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
833 |
memset(fds, 0, sizeof(struct pollfd) * UINT8_MAX); |
834 |
memset(&hints, 0, sizeof (hints)); |
|
835 |
hints.ai_flags= AI_PASSIVE; |
|
836 |
hints.ai_socktype= SOCK_STREAM; |
|
837 |
||
574.2.1
by ysano
Rename mysql to drizzle. |
838 |
snprintf(port_buf, NI_MAXSERV, "%d", drizzled_port); |
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
839 |
error= getaddrinfo(my_bind_addr_str, port_buf, &hints, &ai); |
840 |
if (error != 0) |
|
841 |
{
|
|
842 |
sql_perror(ER(ER_IPSOCK_ERROR)); /* purecov: tested */ |
|
843 |
unireg_abort(1); /* purecov: tested */ |
|
844 |
}
|
|
845 |
||
846 |
for (next= ai, pollfd_count= 0; next; next= next->ai_next, pollfd_count++) |
|
847 |
{
|
|
848 |
int ip_sock; |
|
849 |
||
850 |
ip_sock= socket(next->ai_family, next->ai_socktype, next->ai_protocol); |
|
1
by brian
clean slate |
851 |
|
268
by Brian Aker
Merging up a bunch of assert() and cleanup of my_sock typedef |
852 |
if (ip_sock == -1) |
1
by brian
clean slate |
853 |
{
|
854 |
sql_perror(ER(ER_IPSOCK_ERROR)); /* purecov: tested */ |
|
855 |
unireg_abort(1); /* purecov: tested */ |
|
856 |
}
|
|
857 |
||
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
858 |
fds[pollfd_count].fd= ip_sock; |
859 |
fds[pollfd_count].events= POLLIN | POLLERR; |
|
860 |
||
231
by Brian Aker
Move reuse to working location :) |
861 |
/* Add options for our listening socket */
|
862 |
{
|
|
863 |
struct linger ling = {0, 0}; |
|
864 |
int flags =1; |
|
865 |
||
287.2.3
by Andrew Garner
fixed identation problems |
866 |
#ifdef IPV6_V6ONLY
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
867 |
if (next->ai_family == AF_INET6) |
293
by Brian Aker
Merge + closesocket() fix |
868 |
{
|
287.2.3
by Andrew Garner
fixed identation problems |
869 |
error= setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &flags, sizeof(flags)); |
287.2.1
by Andrew Garner
enable ipv6 in drizzled |
870 |
if (error != 0) |
871 |
{
|
|
872 |
perror("setsockopt"); |
|
873 |
assert(error == 0); |
|
874 |
}
|
|
875 |
}
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
876 |
#endif
|
267
by Brian Aker
More error control around socket calls. |
877 |
error= setsockopt(ip_sock, SOL_SOCKET, SO_REUSEADDR, (char*)&flags, sizeof(flags)); |
878 |
if (error != 0) |
|
879 |
{
|
|
880 |
perror("setsockopt"); |
|
881 |
assert(error == 0); |
|
882 |
}
|
|
883 |
error= setsockopt(ip_sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&flags, sizeof(flags)); |
|
884 |
if (error != 0) |
|
885 |
{
|
|
886 |
perror("setsockopt"); |
|
887 |
assert(error == 0); |
|
888 |
}
|
|
889 |
error= setsockopt(ip_sock, SOL_SOCKET, SO_LINGER, (void *)&ling, sizeof(ling)); |
|
890 |
if (error != 0) |
|
891 |
{
|
|
892 |
perror("setsockopt"); |
|
893 |
assert(error == 0); |
|
894 |
}
|
|
895 |
error= setsockopt(ip_sock, IPPROTO_TCP, TCP_NODELAY, (void *)&flags, sizeof(flags)); |
|
896 |
if (error != 0) |
|
897 |
{
|
|
898 |
perror("setsockopt"); |
|
899 |
assert(error == 0); |
|
900 |
}
|
|
231
by Brian Aker
Move reuse to working location :) |
901 |
}
|
902 |
||
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
903 |
|
1
by brian
clean slate |
904 |
/*
|
905 |
Sometimes the port is not released fast enough when stopping and
|
|
906 |
restarting the server. This happens quite often with the test suite
|
|
907 |
on busy Linux systems. Retry to bind the address at these intervals:
|
|
908 |
Sleep intervals: 1, 2, 4, 6, 9, 13, 17, 22, ...
|
|
909 |
Retry at second: 1, 3, 7, 13, 22, 35, 52, 74, ...
|
|
574.2.1
by ysano
Rename mysql to drizzle. |
910 |
Limit the sequence by drizzled_port_timeout (set --port-open-timeout=#).
|
1
by brian
clean slate |
911 |
*/
|
912 |
for (waited= 0, retry= 1; ; retry++, waited+= this_wait) |
|
913 |
{
|
|
923.2.2
by Monty Taylor
Changed some names that conflict with c++0x reserved names. |
914 |
if (((ret= ::bind(ip_sock, next->ai_addr, next->ai_addrlen)) >= 0 ) || |
429
by Monty Taylor
Removed SOCKET redefines. |
915 |
(errno != EADDRINUSE) || |
574.2.1
by ysano
Rename mysql to drizzle. |
916 |
(waited >= drizzled_port_timeout)) |
1
by brian
clean slate |
917 |
break; |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
918 |
errmsg_printf(ERRMSG_LVL_INFO, _("Retrying bind on TCP/IP port %u"), drizzled_port); |
1
by brian
clean slate |
919 |
this_wait= retry * retry / 3 + 1; |
920 |
sleep(this_wait); |
|
921 |
}
|
|
922 |
if (ret < 0) |
|
923 |
{
|
|
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
924 |
sql_perror(_("Can't start server: Bind on TCP/IP port")); |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
925 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Do you already have another drizzled server running " |
574.2.1
by ysano
Rename mysql to drizzle. |
926 |
"on port: %d ?"),drizzled_port); |
1
by brian
clean slate |
927 |
unireg_abort(1); |
928 |
}
|
|
929 |
if (listen(ip_sock,(int) back_log) < 0) |
|
930 |
{
|
|
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
931 |
sql_perror(_("Can't start server: listen() on TCP/IP port")); |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
932 |
errmsg_printf(ERRMSG_LVL_ERROR, _("listen() on TCP/IP failed with error %d"), |
429
by Monty Taylor
Removed SOCKET redefines. |
933 |
errno); |
1
by brian
clean slate |
934 |
unireg_abort(1); |
935 |
}
|
|
936 |
}
|
|
937 |
||
287.2.1
by Andrew Garner
enable ipv6 in drizzled |
938 |
freeaddrinfo(ai); |
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
939 |
return; |
1
by brian
clean slate |
940 |
}
|
941 |
||
942 |
||
943 |
||
944 |
/** Called when a thread is aborted. */
|
|
945 |
/* ARGSUSED */
|
|
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
946 |
extern "C" void end_thread_signal(int ) |
1
by brian
clean slate |
947 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
948 |
Session *session=current_session; |
949 |
if (session) |
|
1
by brian
clean slate |
950 |
{
|
951 |
statistic_increment(killed_threads, &LOCK_status); |
|
809
by Brian Aker
Refactor of scheduler plugin code to simplify around one structure. Also |
952 |
(void)thread_scheduler.end_thread(session, 0); /* purecov: inspected */ |
1
by brian
clean slate |
953 |
}
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
954 |
return;; /* purecov: deadcode */ |
1
by brian
clean slate |
955 |
}
|
956 |
||
957 |
||
958 |
/*
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
959 |
Unlink session from global list of available connections and free session
|
1
by brian
clean slate |
960 |
|
961 |
SYNOPSIS
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
962 |
unlink_session()
|
963 |
session Thread handler
|
|
1
by brian
clean slate |
964 |
|
965 |
NOTES
|
|
966 |
LOCK_thread_count is locked and left locked
|
|
967 |
*/
|
|
968 |
||
938
by Brian Aker
Merge of Monty/Eric/Padraig |
969 |
void unlink_session(Session *session) |
1
by brian
clean slate |
970 |
{
|
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
971 |
connection_count--; |
972 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
973 |
session->cleanup(); |
1
by brian
clean slate |
974 |
|
947
by Brian Aker
Merge fix |
975 |
(void) pthread_mutex_lock(&LOCK_thread_count); |
948
by Brian Aker
Restoring code Monty deleted. |
976 |
pthread_mutex_lock(&session->LOCK_delete); |
520.1.22
by Brian Aker
Second pass of thd cleanup |
977 |
delete session; |
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
978 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
938
by Brian Aker
Merge of Monty/Eric/Padraig |
979 |
|
853
by Brian Aker
Moved locks around (aka... unlink_session now handles its own locking). |
980 |
return; |
1
by brian
clean slate |
981 |
}
|
982 |
||
983 |
||
984 |
#ifdef THREAD_SPECIFIC_SIGPIPE
|
|
985 |
/**
|
|
986 |
Aborts a thread nicely. Comes here on SIGPIPE.
|
|
987 |
||
988 |
@todo
|
|
989 |
One should have to fix that thr_alarm know about this thread too.
|
|
990 |
*/
|
|
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
991 |
extern "C" void abort_thread(int ) |
1
by brian
clean slate |
992 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
993 |
Session *session=current_session; |
994 |
if (session) |
|
995 |
session->killed= Session::KILL_CONNECTION; |
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
996 |
return;; |
1
by brian
clean slate |
997 |
}
|
998 |
#endif
|
|
999 |
||
492.3.25
by Lee
Changes to get drizzle building on Solaris 10 (SPARC) |
1000 |
#if defined(BACKTRACE_DEMANGLE)
|
1
by brian
clean slate |
1001 |
#include <cxxabi.h> |
1002 |
extern "C" char *my_demangle(const char *mangled_name, int *status) |
|
1003 |
{
|
|
1004 |
return abi::__cxa_demangle(mangled_name, NULL, NULL, status); |
|
1005 |
}
|
|
1006 |
#endif
|
|
1007 |
||
1008 |
||
779.2.11
by Monty Taylor
General build cleanup - removed cruft, removed depreated checks. |
1009 |
extern "C" void handle_segfault(int sig) |
1
by brian
clean slate |
1010 |
{
|
1011 |
time_t curr_time; |
|
1012 |
struct tm tm; |
|
1013 |
||
1014 |
/*
|
|
1015 |
Strictly speaking, one needs a mutex here
|
|
1016 |
but since we have got SIGSEGV already, things are a mess
|
|
1017 |
so not having the mutex is not as bad as possibly using a buggy
|
|
1018 |
mutex - so we keep things simple
|
|
1019 |
*/
|
|
1020 |
if (segfaulted) |
|
1021 |
{
|
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1022 |
fprintf(stderr, _("Fatal " SIGNAL_FMT " while backtracing\n"), sig); |
1
by brian
clean slate |
1023 |
exit(1); |
1024 |
}
|
|
1025 |
||
1026 |
segfaulted = 1; |
|
1027 |
||
685.3.4
by Toru Maesaka
Fixed the issues pointed out by Jay's code review |
1028 |
curr_time= time(NULL); |
1029 |
if(curr_time == (time_t)-1) |
|
685.3.2
by Toru Maesaka
Removed my_time() and added error checking |
1030 |
{
|
1031 |
fprintf(stderr, "Fetal: time() call failed\n"); |
|
1032 |
exit(1); |
|
1033 |
}
|
|
1034 |
||
1
by brian
clean slate |
1035 |
localtime_r(&curr_time, &tm); |
1036 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1037 |
fprintf(stderr,"%02d%02d%02d %2d:%02d:%02d - drizzled got " |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1038 |
SIGNAL_FMT " ;\n" |
1039 |
"This could be because you hit a bug. It is also possible that "
|
|
1040 |
"this binary\n or one of the libraries it was linked against is " |
|
1041 |
"corrupt, improperly built,\n or misconfigured. This error can " |
|
1042 |
"also be caused by malfunctioning hardware.\n", |
|
1
by brian
clean slate |
1043 |
tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday, |
1044 |
tm.tm_hour, tm.tm_min, tm.tm_sec, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1045 |
sig); |
1046 |
fprintf(stderr, _("We will try our best to scrape up some info that " |
|
1047 |
"will hopefully help diagnose\n" |
|
1048 |
"the problem, but since we have already crashed, "
|
|
1049 |
"something is definitely wrong\nand this may fail.\n\n")); |
|
366
by Patrick Galbraith
Ulong conversion |
1050 |
fprintf(stderr, "key_buffer_size=%u\n", |
1051 |
(uint32_t) dflt_key_cache->key_cache_mem_size); |
|
1
by brian
clean slate |
1052 |
fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size); |
366
by Patrick Galbraith
Ulong conversion |
1053 |
fprintf(stderr, "max_used_connections=%u\n", max_used_connections); |
1
by brian
clean slate |
1054 |
fprintf(stderr, "max_threads=%u\n", thread_scheduler.max_threads); |
929.1.1
by Brian Aker
Push thread count out to the scheduler. |
1055 |
fprintf(stderr, "thread_count=%u\n", thread_scheduler.count()); |
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
1056 |
fprintf(stderr, "connection_count=%u\n", uint32_t(connection_count)); |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1057 |
fprintf(stderr, _("It is possible that drizzled could use up to \n" |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1058 |
"key_buffer_size + (read_buffer_size + "
|
622
by Brian Aker
More ulong work. |
1059 |
"sort_buffer_size)*max_threads = %"PRIu64" K\n" |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1060 |
"bytes of memory\n" |
1061 |
"Hope that's ok; if not, decrease some variables in the "
|
|
1062 |
"equation.\n\n"), |
|
622
by Brian Aker
More ulong work. |
1063 |
(uint64_t)(((uint32_t) dflt_key_cache->key_cache_mem_size + |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1064 |
(global_system_variables.read_buff_size + |
1065 |
global_system_variables.sortbuff_size) * |
|
832.2.4
by Mark Atwood
remove max_connections from memory use message |
1066 |
thread_scheduler.max_threads) / 1024)); |
1
by brian
clean slate |
1067 |
|
1068 |
#ifdef HAVE_STACKTRACE
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1069 |
Session *session= current_session; |
182.1.2
by Jim Winstead
Various fixes to enable compilation on Mac OS X, and remove the glib dependency. |
1070 |
|
1
by brian
clean slate |
1071 |
if (!(test_flags & TEST_NO_STACKTRACE)) |
1072 |
{
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1073 |
fprintf(stderr,"session: 0x%lx\n",(long) session); |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1074 |
fprintf(stderr,_("Attempting backtrace. You can use the following " |
1075 |
"information to find out\n" |
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1076 |
"where drizzled died. If you see no messages after this, "
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1077 |
"something went\n" |
1078 |
"terribly wrong...\n")); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1079 |
print_stacktrace(session ? (unsigned char*) session->thread_stack : (unsigned char*) 0, |
1
by brian
clean slate |
1080 |
my_thread_stack_size); |
1081 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1082 |
if (session) |
1
by brian
clean slate |
1083 |
{
|
1084 |
const char *kreason= "UNKNOWN"; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1085 |
switch (session->killed) { |
520.1.21
by Brian Aker
THD -> Session rename |
1086 |
case Session::NOT_KILLED: |
1
by brian
clean slate |
1087 |
kreason= "NOT_KILLED"; |
1088 |
break; |
|
520.1.21
by Brian Aker
THD -> Session rename |
1089 |
case Session::KILL_BAD_DATA: |
1
by brian
clean slate |
1090 |
kreason= "KILL_BAD_DATA"; |
1091 |
break; |
|
520.1.21
by Brian Aker
THD -> Session rename |
1092 |
case Session::KILL_CONNECTION: |
1
by brian
clean slate |
1093 |
kreason= "KILL_CONNECTION"; |
1094 |
break; |
|
520.1.21
by Brian Aker
THD -> Session rename |
1095 |
case Session::KILL_QUERY: |
1
by brian
clean slate |
1096 |
kreason= "KILL_QUERY"; |
1097 |
break; |
|
520.1.21
by Brian Aker
THD -> Session rename |
1098 |
case Session::KILLED_NO_VALUE: |
1
by brian
clean slate |
1099 |
kreason= "KILLED_NO_VALUE"; |
1100 |
break; |
|
1101 |
}
|
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1102 |
fprintf(stderr, _("Trying to get some variables.\n" |
1103 |
"Some pointers may be invalid and cause the "
|
|
1104 |
"dump to abort...\n")); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1105 |
safe_print_str("session->query", session->query, 1024); |
1106 |
fprintf(stderr, "session->thread_id=%"PRIu32"\n", (uint32_t) session->thread_id); |
|
1107 |
fprintf(stderr, "session->killed=%s\n", kreason); |
|
1
by brian
clean slate |
1108 |
}
|
1109 |
fflush(stderr); |
|
1110 |
#endif /* HAVE_STACKTRACE */ |
|
1111 |
||
1112 |
#ifdef HAVE_INITGROUPS
|
|
1113 |
if (calling_initgroups) |
|
672.1.3
by Andrew Hutchings
Minor string fixes (mainly US English spelling and typos) |
1114 |
fprintf(stderr, _("\nThis crash occurred while the server was calling " |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1115 |
"initgroups(). This is\n" |
1116 |
"often due to the use of a drizzled that is statically "
|
|
1117 |
"linked against glibc\n" |
|
1118 |
"and configured to use LDAP in /etc/nsswitch.conf. "
|
|
1119 |
"You will need to either\n" |
|
1120 |
"upgrade to a version of glibc that does not have this "
|
|
1121 |
"problem (2.3.4 or\n" |
|
1122 |
"later when used with nscd), disable LDAP in your "
|
|
1123 |
"nsswitch.conf, or use a\n" |
|
1124 |
"drizzled that is not statically linked.\n")); |
|
1
by brian
clean slate |
1125 |
#endif
|
1126 |
||
1127 |
if (thd_lib_detected == THD_LIB_LT && !getenv("LD_ASSUME_KERNEL")) |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1128 |
fprintf(stderr, |
1129 |
_("\nYou are running a statically-linked LinuxThreads binary " |
|
1130 |
"on an NPTL system.\n" |
|
1131 |
"This can result in crashes on some distributions due "
|
|
1132 |
"to LT/NPTL conflicts.\n" |
|
1133 |
"You should either build a dynamically-linked binary, or force "
|
|
1134 |
"LinuxThreads\n" |
|
1135 |
"to be used with the LD_ASSUME_KERNEL environment variable. "
|
|
1136 |
"Please consult\n" |
|
1137 |
"the documentation for your distribution on how to do that.\n")); |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1138 |
|
1
by brian
clean slate |
1139 |
if (locked_in_memory) |
1140 |
{
|
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1141 |
fprintf(stderr, |
1142 |
_("\nThe '--memlock' argument, which was enabled, uses system " |
|
1143 |
"calls that are\n" |
|
1144 |
"unreliable and unstable on some operating systems and "
|
|
1145 |
"operating-system\n" |
|
1146 |
"versions (notably, some versions of Linux). "
|
|
1147 |
"This crash could be due to use\n" |
|
1148 |
"of those buggy OS calls. You should consider whether you "
|
|
1149 |
"really need the\n" |
|
1150 |
"'--memlock' parameter and/or consult the OS "
|
|
1151 |
"distributor about 'mlockall'\n bugs.\n")); |
|
1
by brian
clean slate |
1152 |
}
|
1153 |
||
1154 |
#ifdef HAVE_WRITE_CORE
|
|
1155 |
if (test_flags & TEST_CORE_ON_SIGNAL) |
|
1156 |
{
|
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1157 |
fprintf(stderr, _("Writing a core file\n")); |
1
by brian
clean slate |
1158 |
fflush(stderr); |
1159 |
write_core(sig); |
|
1160 |
}
|
|
1161 |
#endif
|
|
1162 |
||
1163 |
exit(1); |
|
1164 |
}
|
|
1165 |
||
1166 |
#ifndef SA_RESETHAND
|
|
1167 |
#define SA_RESETHAND 0
|
|
1168 |
#endif
|
|
1169 |
#ifndef SA_NODEFER
|
|
1170 |
#define SA_NODEFER 0
|
|
1171 |
#endif
|
|
1172 |
||
1173 |
static void init_signals(void) |
|
1174 |
{
|
|
1175 |
sigset_t set; |
|
1176 |
struct sigaction sa; |
|
1177 |
||
1178 |
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL)) |
|
1179 |
{
|
|
1180 |
sa.sa_flags = SA_RESETHAND | SA_NODEFER; |
|
1181 |
sigemptyset(&sa.sa_mask); |
|
1182 |
sigprocmask(SIG_SETMASK,&sa.sa_mask,NULL); |
|
1183 |
||
1184 |
init_stacktrace(); |
|
1185 |
sa.sa_handler=handle_segfault; |
|
1186 |
sigaction(SIGSEGV, &sa, NULL); |
|
1187 |
sigaction(SIGABRT, &sa, NULL); |
|
1188 |
#ifdef SIGBUS
|
|
1189 |
sigaction(SIGBUS, &sa, NULL); |
|
1190 |
#endif
|
|
1191 |
sigaction(SIGILL, &sa, NULL); |
|
1192 |
sigaction(SIGFPE, &sa, NULL); |
|
1193 |
}
|
|
1194 |
||
1195 |
#ifdef HAVE_GETRLIMIT
|
|
1196 |
if (test_flags & TEST_CORE_ON_SIGNAL) |
|
1197 |
{
|
|
1198 |
/* Change limits so that we will get a core file */
|
|
942.1.7
by Monty Taylor
Removed check for rlimit64... we set FILE_OFFSET_BITS properly, so it's not necessary on modern unixes (post 1998-ish) |
1199 |
struct rlimit rl; |
1
by brian
clean slate |
1200 |
rl.rlim_cur = rl.rlim_max = RLIM_INFINITY; |
1201 |
if (setrlimit(RLIMIT_CORE, &rl) && global_system_variables.log_warnings) |
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1202 |
errmsg_printf(ERRMSG_LVL_WARN, _("setrlimit could not change the size of core files " |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
1203 |
"to 'infinity'; We may not be able to generate a "
|
1204 |
"core file on signals")); |
|
1
by brian
clean slate |
1205 |
}
|
1206 |
#endif
|
|
1207 |
(void) sigemptyset(&set); |
|
1208 |
my_sigset(SIGPIPE,SIG_IGN); |
|
1209 |
sigaddset(&set,SIGPIPE); |
|
1210 |
#ifndef IGNORE_SIGHUP_SIGQUIT
|
|
1211 |
sigaddset(&set,SIGQUIT); |
|
1212 |
sigaddset(&set,SIGHUP); |
|
1213 |
#endif
|
|
1214 |
sigaddset(&set,SIGTERM); |
|
1215 |
||
1216 |
/* Fix signals if blocked by parents (can happen on Mac OS X) */
|
|
1217 |
sigemptyset(&sa.sa_mask); |
|
1218 |
sa.sa_flags = 0; |
|
1219 |
sa.sa_handler = print_signal_warning; |
|
1220 |
sigaction(SIGTERM, &sa, (struct sigaction*) 0); |
|
1221 |
sa.sa_flags = 0; |
|
1222 |
sa.sa_handler = print_signal_warning; |
|
1223 |
sigaction(SIGHUP, &sa, (struct sigaction*) 0); |
|
1224 |
#ifdef SIGTSTP
|
|
1225 |
sigaddset(&set,SIGTSTP); |
|
1226 |
#endif
|
|
1227 |
if (test_flags & TEST_SIGINT) |
|
1228 |
{
|
|
1229 |
my_sigset(thr_kill_signal, end_thread_signal); |
|
1230 |
// May be SIGINT
|
|
1231 |
sigdelset(&set, thr_kill_signal); |
|
1232 |
}
|
|
1233 |
else
|
|
1234 |
sigaddset(&set,SIGINT); |
|
1235 |
sigprocmask(SIG_SETMASK,&set,NULL); |
|
1236 |
pthread_sigmask(SIG_SETMASK,&set,NULL); |
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
1237 |
return;; |
1
by brian
clean slate |
1238 |
}
|
1239 |
||
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
1240 |
static void check_data_home(const char *) |
1
by brian
clean slate |
1241 |
{}
|
1242 |
||
1243 |
||
1244 |
/**
|
|
1245 |
All global error messages are sent here where the first one is stored
|
|
1246 |
for the client.
|
|
1247 |
*/
|
|
1248 |
/* ARGSUSED */
|
|
482
by Brian Aker
Remove uint. |
1249 |
extern "C" void my_message_sql(uint32_t error, const char *str, myf MyFlags); |
1
by brian
clean slate |
1250 |
|
482
by Brian Aker
Remove uint. |
1251 |
void my_message_sql(uint32_t error, const char *str, myf MyFlags) |
1
by brian
clean slate |
1252 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1253 |
Session *session; |
1
by brian
clean slate |
1254 |
/*
|
1255 |
Put here following assertion when situation with EE_* error codes
|
|
1256 |
will be fixed
|
|
1257 |
*/
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1258 |
if ((session= current_session)) |
1
by brian
clean slate |
1259 |
{
|
1260 |
if (MyFlags & ME_FATALERROR) |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1261 |
session->is_fatal_error= 1; |
1
by brian
clean slate |
1262 |
|
1263 |
/*
|
|
520.1.21
by Brian Aker
THD -> Session rename |
1264 |
TODO: There are two exceptions mechanism (Session and sp_rcontext),
|
1
by brian
clean slate |
1265 |
this could be improved by having a common stack of handlers.
|
1266 |
*/
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1267 |
if (session->handle_error(error, str, |
261.4.1
by Felipe
- Renamed MYSQL_ERROR to DRIZZLE_ERROR. |
1268 |
DRIZZLE_ERROR::WARN_LEVEL_ERROR)) |
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
1269 |
return;; |
1
by brian
clean slate |
1270 |
|
1271 |
/*
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1272 |
session->lex->current_select == 0 if lex structure is not inited
|
1
by brian
clean slate |
1273 |
(not query command (COM_QUERY))
|
1274 |
*/
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1275 |
if (! (session->lex->current_select && |
1276 |
session->lex->current_select->no_error && !session->is_fatal_error)) |
|
1
by brian
clean slate |
1277 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1278 |
if (! session->main_da.is_error()) // Return only first message |
1
by brian
clean slate |
1279 |
{
|
1280 |
if (error == 0) |
|
1281 |
error= ER_UNKNOWN_ERROR; |
|
1282 |
if (str == NULL) |
|
1283 |
str= ER(error); |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1284 |
session->main_da.set_error_status(session, error, str); |
1
by brian
clean slate |
1285 |
}
|
1286 |
}
|
|
1287 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1288 |
if (!session->no_warnings_for_error && !session->is_fatal_error) |
1
by brian
clean slate |
1289 |
{
|
1290 |
/*
|
|
1291 |
Suppress infinite recursion if there a memory allocation error
|
|
1292 |
inside push_warning.
|
|
1293 |
*/
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1294 |
session->no_warnings_for_error= true; |
1295 |
push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR, error, str); |
|
1296 |
session->no_warnings_for_error= false; |
|
1
by brian
clean slate |
1297 |
}
|
1298 |
}
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1299 |
if (!session || MyFlags & ME_NOREFRESH) |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1300 |
errmsg_printf(ERRMSG_LVL_ERROR, "%s: %s",my_progname,str); /* purecov: inspected */ |
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
1301 |
return;; |
1
by brian
clean slate |
1302 |
}
|
1303 |
||
1304 |
||
1305 |
static const char *load_default_groups[]= { |
|
722.1.3
by Monty Taylor
Cleaned up a few build things. |
1306 |
DRIZZLE_CONFIG_NAME,"server", DRIZZLE_BASE_VERSION, 0, 0}; |
1
by brian
clean slate |
1307 |
|
1308 |
SHOW_VAR com_status_vars[]= { |
|
1309 |
{"admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS}, |
|
895
by Brian Aker
Completion (?) of uint conversion. |
1310 |
{"assign_to_keycache", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ASSIGN_TO_KEYCACHE]), SHOW_LONG_STATUS}, |
1311 |
{"alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS}, |
|
1312 |
{"alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS}, |
|
1313 |
{"analyze", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ANALYZE]), SHOW_LONG_STATUS}, |
|
1314 |
{"begin", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_BEGIN]), SHOW_LONG_STATUS}, |
|
1315 |
{"change_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CHANGE_DB]), SHOW_LONG_STATUS}, |
|
1316 |
{"check", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CHECK]), SHOW_LONG_STATUS}, |
|
1317 |
{"checksum", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CHECKSUM]), SHOW_LONG_STATUS}, |
|
1318 |
{"commit", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_COMMIT]), SHOW_LONG_STATUS}, |
|
1319 |
{"create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CREATE_DB]), SHOW_LONG_STATUS}, |
|
1320 |
{"create_index", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CREATE_INDEX]), SHOW_LONG_STATUS}, |
|
1321 |
{"create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_CREATE_TABLE]), SHOW_LONG_STATUS}, |
|
1322 |
{"delete", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DELETE]), SHOW_LONG_STATUS}, |
|
1323 |
{"delete_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DELETE_MULTI]), SHOW_LONG_STATUS}, |
|
1324 |
{"drop_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_DB]), SHOW_LONG_STATUS}, |
|
1325 |
{"drop_index", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_INDEX]), SHOW_LONG_STATUS}, |
|
1326 |
{"drop_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_DROP_TABLE]), SHOW_LONG_STATUS}, |
|
1327 |
{"empty_query", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_EMPTY_QUERY]), SHOW_LONG_STATUS}, |
|
1328 |
{"flush", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_FLUSH]), SHOW_LONG_STATUS}, |
|
1329 |
{"insert", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_INSERT]), SHOW_LONG_STATUS}, |
|
1330 |
{"insert_select", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_INSERT_SELECT]), SHOW_LONG_STATUS}, |
|
1331 |
{"kill", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_KILL]), SHOW_LONG_STATUS}, |
|
1332 |
{"load", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_LOAD]), SHOW_LONG_STATUS}, |
|
1333 |
{"lock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_LOCK_TABLES]), SHOW_LONG_STATUS}, |
|
1334 |
{"optimize", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_OPTIMIZE]), SHOW_LONG_STATUS}, |
|
1335 |
{"release_savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_RELEASE_SAVEPOINT]), SHOW_LONG_STATUS}, |
|
1336 |
{"rename_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_RENAME_TABLE]), SHOW_LONG_STATUS}, |
|
1337 |
{"repair", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_REPAIR]), SHOW_LONG_STATUS}, |
|
1338 |
{"replace", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_REPLACE]), SHOW_LONG_STATUS}, |
|
1339 |
{"replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS}, |
|
1340 |
{"rollback", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ROLLBACK]), SHOW_LONG_STATUS}, |
|
1341 |
{"rollback_to_savepoint",(char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_ROLLBACK_TO_SAVEPOINT]), SHOW_LONG_STATUS}, |
|
1342 |
{"savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SAVEPOINT]), SHOW_LONG_STATUS}, |
|
1343 |
{"select", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SELECT]), SHOW_LONG_STATUS}, |
|
1344 |
{"set_option", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SET_OPTION]), SHOW_LONG_STATUS}, |
|
1345 |
{"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS}, |
|
1346 |
{"show_create_table", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_CREATE]), SHOW_LONG_STATUS}, |
|
1347 |
{"show_databases", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_DATABASES]), SHOW_LONG_STATUS}, |
|
1348 |
{"show_engine_status", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_ENGINE_STATUS]), SHOW_LONG_STATUS}, |
|
1349 |
{"show_errors", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_ERRORS]), SHOW_LONG_STATUS}, |
|
1350 |
{"show_fields", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_FIELDS]), SHOW_LONG_STATUS}, |
|
1351 |
{"show_keys", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_KEYS]), SHOW_LONG_STATUS}, |
|
1352 |
{"show_open_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_OPEN_TABLES]), SHOW_LONG_STATUS}, |
|
1353 |
{"show_plugins", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_PLUGINS]), SHOW_LONG_STATUS}, |
|
1354 |
{"show_processlist", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_PROCESSLIST]), SHOW_LONG_STATUS}, |
|
1355 |
{"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS}, |
|
1356 |
{"show_table_status", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_TABLE_STATUS]), SHOW_LONG_STATUS}, |
|
1357 |
{"show_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_TABLES]), SHOW_LONG_STATUS}, |
|
1358 |
{"show_variables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS}, |
|
1359 |
{"show_warnings", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS}, |
|
1360 |
{"truncate", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_TRUNCATE]), SHOW_LONG_STATUS}, |
|
1361 |
{"unlock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UNLOCK_TABLES]), SHOW_LONG_STATUS}, |
|
1362 |
{"update", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UPDATE]), SHOW_LONG_STATUS}, |
|
1363 |
{"update_multi", (char*) offsetof(STATUS_VAR, com_stat[(uint32_t) SQLCOM_UPDATE_MULTI]), SHOW_LONG_STATUS}, |
|
625
by Brian Aker
ulong/64 bit straighten out. |
1364 |
{NULL, NULL, SHOW_LONGLONG} |
1
by brian
clean slate |
1365 |
};
|
1366 |
||
1367 |
static int init_common_variables(const char *conf_file_name, int argc, |
|
685.3.2
by Toru Maesaka
Removed my_time() and added error checking |
1368 |
char **argv, const char **groups) |
1
by brian
clean slate |
1369 |
{
|
685.3.4
by Toru Maesaka
Fixed the issues pointed out by Jay's code review |
1370 |
time_t curr_time; |
1
by brian
clean slate |
1371 |
umask(((~my_umask) & 0666)); |
1372 |
my_decimal_set_zero(&decimal_zero); // set decimal_zero constant; |
|
1373 |
tzset(); // Set tzname |
|
1374 |
||
685.3.4
by Toru Maesaka
Fixed the issues pointed out by Jay's code review |
1375 |
curr_time= time(NULL); |
1376 |
if (curr_time == (time_t)-1) |
|
685.3.2
by Toru Maesaka
Removed my_time() and added error checking |
1377 |
return 1; |
1378 |
||
298
by Brian Aker
ulong conversion. |
1379 |
max_system_variables.pseudo_thread_id= UINT32_MAX; |
685.3.4
by Toru Maesaka
Fixed the issues pointed out by Jay's code review |
1380 |
server_start_time= flush_status_time= curr_time; |
1
by brian
clean slate |
1381 |
|
1382 |
if (init_thread_environment()) |
|
1383 |
return 1; |
|
574.2.1
by ysano
Rename mysql to drizzle. |
1384 |
drizzle_init_variables(); |
1
by brian
clean slate |
1385 |
|
1386 |
{
|
|
1387 |
struct tm tm_tmp; |
|
1388 |
localtime_r(&server_start_time,&tm_tmp); |
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
1389 |
strncpy(system_time_zone, tzname[tm_tmp.tm_isdst != 0 ? 1 : 0], |
1
by brian
clean slate |
1390 |
sizeof(system_time_zone)-1); |
1391 |
||
1392 |
}
|
|
1393 |
/*
|
|
1394 |
We set SYSTEM time zone as reasonable default and
|
|
1395 |
also for failure of my_tz_init() and bootstrap mode.
|
|
1396 |
If user explicitly set time zone with --default-time-zone
|
|
1397 |
option we will change this value in my_tz_init().
|
|
1398 |
*/
|
|
1399 |
global_system_variables.time_zone= my_tz_SYSTEM; |
|
1400 |
||
1401 |
if (gethostname(glob_hostname,sizeof(glob_hostname)) < 0) |
|
1402 |
{
|
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
1403 |
strncpy(glob_hostname, STRING_WITH_LEN("localhost")); |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1404 |
errmsg_printf(ERRMSG_LVL_WARN, _("gethostname failed, using '%s' as hostname"), |
1
by brian
clean slate |
1405 |
glob_hostname); |
907.1.2
by Jay Pipes
Merging in old r902 temporal changes |
1406 |
strncpy(pidfile_name, STRING_WITH_LEN("drizzle")); |
1
by brian
clean slate |
1407 |
}
|
1408 |
else
|
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
1409 |
strncpy(pidfile_name, glob_hostname, sizeof(pidfile_name)-5); |
641.4.1
by Toru Maesaka
First pass of replacing MySQL's my_stpcpy() with appropriate libc calls |
1410 |
strcpy(fn_ext(pidfile_name),".pid"); // Add proper extension |
1
by brian
clean slate |
1411 |
|
1412 |
/*
|
|
1413 |
Add server status variables to the dynamic list of
|
|
1414 |
status variables that is shown by SHOW STATUS.
|
|
1415 |
Later, in plugin_init, and mysql_install_plugin
|
|
1416 |
new entries could be added to that list.
|
|
1417 |
*/
|
|
1418 |
if (add_status_vars(status_vars)) |
|
1419 |
return 1; // an error was already reported |
|
1420 |
||
1421 |
load_defaults(conf_file_name, groups, &argc, &argv); |
|
1422 |
defaults_argv=argv; |
|
1423 |
defaults_argc=argc; |
|
1424 |
get_options(&defaults_argc, defaults_argv); |
|
1425 |
set_server_version(); |
|
1426 |
||
1427 |
||
1428 |
/* connections and databases needs lots of files */
|
|
832.2.10
by Mark Atwood
remove open_files_limit parameter |
1429 |
(void) my_set_max_open_files(0xFFFFFFFF); |
832.2.5
by Mark Atwood
Remove max_connection and max_open_files resizing |
1430 |
|
909
by Brian Aker
Remove the need for unireg init |
1431 |
current_pid=(ulong) getpid(); /* Save for later ref */ |
1432 |
init_time(); /* Init time-functions (read zone) */ |
|
1433 |
||
1
by brian
clean slate |
1434 |
if (init_errmessage()) /* Read error messages from file */ |
1435 |
return 1; |
|
1436 |
if (item_create_init()) |
|
1437 |
return 1; |
|
1438 |
if (set_var_init()) |
|
1439 |
return 1; |
|
813.1.2
by Jay Pipes
First function cleanup for temporal handling: YEAR() |
1440 |
/* Creates static regex matching for temporal values */
|
1441 |
if (! init_temporal_formats()) |
|
1442 |
return 1; |
|
1
by brian
clean slate |
1443 |
/*
|
1444 |
Process a comma-separated character set list and choose
|
|
1445 |
the first available character set. This is mostly for
|
|
1446 |
test purposes, to be able to start "mysqld" even if
|
|
1447 |
the requested character set is not available (see bug#18743).
|
|
1448 |
*/
|
|
1449 |
for (;;) |
|
1450 |
{
|
|
1451 |
char *next_character_set_name= strchr(default_character_set_name, ','); |
|
1452 |
if (next_character_set_name) |
|
1453 |
*next_character_set_name++= '\0'; |
|
1454 |
if (!(default_charset_info= |
|
862
by Brian Aker
Remove charset directory code. |
1455 |
get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY))) |
1
by brian
clean slate |
1456 |
{
|
1457 |
if (next_character_set_name) |
|
1458 |
{
|
|
1459 |
default_character_set_name= next_character_set_name; |
|
1460 |
default_collation_name= 0; // Ignore collation |
|
1461 |
}
|
|
1462 |
else
|
|
1463 |
return 1; // Eof of the list |
|
1464 |
}
|
|
1465 |
else
|
|
1466 |
break; |
|
1467 |
}
|
|
1468 |
||
1469 |
if (default_collation_name) |
|
1470 |
{
|
|
862
by Brian Aker
Remove charset directory code. |
1471 |
const CHARSET_INFO * const default_collation= get_charset_by_name(default_collation_name); |
1
by brian
clean slate |
1472 |
if (!default_collation) |
1473 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1474 |
errmsg_printf(ERRMSG_LVL_ERROR, _(ER(ER_UNKNOWN_COLLATION)), default_collation_name); |
1
by brian
clean slate |
1475 |
return 1; |
1476 |
}
|
|
1477 |
if (!my_charset_same(default_charset_info, default_collation)) |
|
1478 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1479 |
errmsg_printf(ERRMSG_LVL_ERROR, _(ER(ER_COLLATION_CHARSET_MISMATCH)), |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
1480 |
default_collation_name, |
1481 |
default_charset_info->csname); |
|
1
by brian
clean slate |
1482 |
return 1; |
1483 |
}
|
|
1484 |
default_charset_info= default_collation; |
|
1485 |
}
|
|
1486 |
/* Set collactions that depends on the default collation */
|
|
1487 |
global_system_variables.collation_server= default_charset_info; |
|
1488 |
global_system_variables.collation_database= default_charset_info; |
|
1489 |
||
1490 |
global_system_variables.optimizer_use_mrr= 1; |
|
1491 |
global_system_variables.optimizer_switch= 0; |
|
1492 |
||
236.1.40
by Monty Taylor
A few meaningless changes. |
1493 |
if (!(character_set_filesystem= |
862
by Brian Aker
Remove charset directory code. |
1494 |
get_charset_by_csname(character_set_filesystem_name, MY_CS_PRIMARY))) |
1
by brian
clean slate |
1495 |
return 1; |
1496 |
global_system_variables.character_set_filesystem= character_set_filesystem; |
|
1497 |
||
1498 |
if (!(my_default_lc_time_names= |
|
1499 |
my_locale_by_name(lc_time_names_name))) |
|
1500 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1501 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Unknown locale: '%s'"), lc_time_names_name); |
1
by brian
clean slate |
1502 |
return 1; |
1503 |
}
|
|
1504 |
global_system_variables.lc_time_names= my_default_lc_time_names; |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1505 |
|
1
by brian
clean slate |
1506 |
sys_init_connect.value_length= 0; |
1507 |
if ((sys_init_connect.value= opt_init_connect)) |
|
1508 |
sys_init_connect.value_length= strlen(opt_init_connect); |
|
1509 |
else
|
|
656.1.19
by Monty Taylor
Removed my_strdup from drizzled/ |
1510 |
sys_init_connect.value=strdup(""); |
656.1.52
by Monty Taylor
Added more return value checks. |
1511 |
if (sys_init_connect.value == NULL) |
1512 |
return 1; |
|
1
by brian
clean slate |
1513 |
|
1514 |
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1)) |
|
1515 |
return 1; |
|
1516 |
||
1517 |
/* Reset table_alias_charset, now that lower_case_table_names is set. */
|
|
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
1518 |
lower_case_table_names= 1; /* This we need to look at */ |
224.2.1
by Brian Aker
First pass for table name issue across platforms. |
1519 |
table_alias_charset= files_charset_info; |
1
by brian
clean slate |
1520 |
|
1521 |
return 0; |
|
1522 |
}
|
|
1523 |
||
1524 |
||
1525 |
static int init_thread_environment() |
|
1526 |
{
|
|
840.1.21
by Monty Taylor
ZOMG. Renamed all the rest of the stuff in libdrizzleclient to be drizzleclient_*. I love commandline perl. |
1527 |
(void) pthread_mutex_init(&LOCK_drizzleclient_create_db,MY_MUTEX_INIT_SLOW); |
1
by brian
clean slate |
1528 |
(void) pthread_mutex_init(&LOCK_lock_db,MY_MUTEX_INIT_SLOW); |
1529 |
(void) pthread_mutex_init(&LOCK_open, NULL); |
|
1530 |
(void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); |
|
1531 |
(void) pthread_mutex_init(&LOCK_status,MY_MUTEX_INIT_FAST); |
|
1532 |
(void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST); |
|
658
by Brian Aker
Part removal of my_pthread.h |
1533 |
(void) pthread_rwlock_init(&LOCK_system_variables_hash, NULL); |
1
by brian
clean slate |
1534 |
(void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST); |
658
by Brian Aker
Part removal of my_pthread.h |
1535 |
(void) pthread_rwlock_init(&LOCK_sys_init_connect, NULL); |
1
by brian
clean slate |
1536 |
(void) pthread_cond_init(&COND_thread_count,NULL); |
1537 |
(void) pthread_cond_init(&COND_refresh,NULL); |
|
1538 |
(void) pthread_cond_init(&COND_global_read_lock,NULL); |
|
1539 |
||
520.1.21
by Brian Aker
THD -> Session rename |
1540 |
if (pthread_key_create(&THR_Session,NULL) || |
670.2.1
by Monty Taylor
Moved pthread keys |
1541 |
pthread_key_create(&THR_Mem_root,NULL)) |
1
by brian
clean slate |
1542 |
{
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1543 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Can't create thread-keys")); |
1
by brian
clean slate |
1544 |
return 1; |
1545 |
}
|
|
1546 |
return 0; |
|
1547 |
}
|
|
1548 |
||
1549 |
||
1550 |
static int init_server_components() |
|
1551 |
{
|
|
1552 |
/*
|
|
1553 |
We need to call each of these following functions to ensure that
|
|
1554 |
all things are initialized so that unireg_abort() doesn't fail
|
|
1555 |
*/
|
|
1556 |
if (table_cache_init() | table_def_init()) |
|
1557 |
unireg_abort(1); |
|
1558 |
||
892.2.3
by Monty Taylor
Fixed fixes. |
1559 |
drizzleclient_randominit(&sql_rand, |
1560 |
(uint64_t) server_start_time, |
|
1561 |
(uint64_t) server_start_time/2); |
|
1
by brian
clean slate |
1562 |
setup_fpu(); |
1563 |
init_thr_lock(); |
|
1564 |
||
1565 |
/* Setup logs */
|
|
1566 |
||
1567 |
if (xid_cache_init()) |
|
1568 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1569 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Out of memory")); |
1
by brian
clean slate |
1570 |
unireg_abort(1); |
1571 |
}
|
|
1572 |
||
1573 |
/* call ha_init_key_cache() on all key caches to init them */
|
|
1574 |
process_key_caches(&ha_init_key_cache); |
|
1575 |
||
1576 |
/* Allow storage engine to give real error messages */
|
|
1577 |
if (ha_init_errors()) |
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
1578 |
return(1); |
1
by brian
clean slate |
1579 |
|
1580 |
if (plugin_init(&defaults_argc, defaults_argv, |
|
1581 |
(opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | |
|
1582 |
(opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) |
|
1583 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1584 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Failed to initialize plugins.")); |
1
by brian
clean slate |
1585 |
unireg_abort(1); |
1586 |
}
|
|
1587 |
||
1588 |
if (opt_help) |
|
1589 |
unireg_abort(0); |
|
1590 |
||
1591 |
/* we do want to exit if there are any other unknown options */
|
|
1592 |
if (defaults_argc > 1) |
|
1593 |
{
|
|
1594 |
int ho_error; |
|
1595 |
char **tmp_argv= defaults_argv; |
|
1596 |
struct my_option no_opts[]= |
|
1597 |
{
|
|
1598 |
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} |
|
1599 |
};
|
|
1600 |
/*
|
|
1601 |
We need to eat any 'loose' arguments first before we conclude
|
|
1602 |
that there are unprocessed options.
|
|
1603 |
But we need to preserve defaults_argv pointer intact for
|
|
1604 |
free_defaults() to work. Thus we use a copy here.
|
|
1605 |
*/
|
|
1606 |
my_getopt_skip_unknown= 0; |
|
1607 |
||
1608 |
if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts, |
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1609 |
drizzled_get_one_option))) |
1
by brian
clean slate |
1610 |
unireg_abort(ho_error); |
1611 |
||
1612 |
if (defaults_argc) |
|
1613 |
{
|
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
1614 |
fprintf(stderr, |
1615 |
_("%s: Too many arguments (first extra is '%s').\n" |
|
1616 |
"Use --verbose --help to get a list of available options\n"), |
|
1
by brian
clean slate |
1617 |
my_progname, *tmp_argv); |
1618 |
unireg_abort(1); |
|
1619 |
}
|
|
1620 |
}
|
|
1621 |
||
1622 |
/* We have to initialize the storage engines before CSV logging */
|
|
1623 |
if (ha_init()) |
|
1624 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1625 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Can't init databases")); |
1
by brian
clean slate |
1626 |
unireg_abort(1); |
1627 |
}
|
|
1628 |
||
1629 |
/*
|
|
1630 |
Check that the default storage engine is actually available.
|
|
1631 |
*/
|
|
1632 |
if (default_storage_engine_str) |
|
1633 |
{
|
|
1634 |
LEX_STRING name= { default_storage_engine_str, |
|
1635 |
strlen(default_storage_engine_str) }; |
|
1636 |
plugin_ref plugin; |
|
1637 |
handlerton *hton; |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1638 |
|
1
by brian
clean slate |
1639 |
if ((plugin= ha_resolve_by_name(0, &name))) |
236.1.44
by Monty Taylor
Added en_US translation file. |
1640 |
{
|
202.3.11
by Monty Taylor
Ding dong. errmsg.sys is dead. |
1641 |
hton= plugin_data(plugin,handlerton *); |
236.1.44
by Monty Taylor
Added en_US translation file. |
1642 |
}
|
1
by brian
clean slate |
1643 |
else
|
1644 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1645 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Unknown/unsupported table type: %s"), |
1
by brian
clean slate |
1646 |
default_storage_engine_str); |
1647 |
unireg_abort(1); |
|
1648 |
}
|
|
1649 |
if (!ha_storage_engine_is_enabled(hton)) |
|
1650 |
{
|
|
907.3.5
by Monty Taylor
Fixed new 64-bit caused solaris warnings. |
1651 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Default storage engine (%s) is not available"), |
1652 |
default_storage_engine_str); |
|
228
by Brian Aker
First pass on socket cleanup. |
1653 |
unireg_abort(1); |
907.3.5
by Monty Taylor
Fixed new 64-bit caused solaris warnings. |
1654 |
//assert(global_system_variables.table_plugin);
|
1
by brian
clean slate |
1655 |
}
|
1656 |
else
|
|
1657 |
{
|
|
1658 |
/*
|
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1659 |
Need to unlock as global_system_variables.table_plugin
|
1
by brian
clean slate |
1660 |
was acquired during plugin_init()
|
1661 |
*/
|
|
1662 |
plugin_unlock(0, global_system_variables.table_plugin); |
|
1663 |
global_system_variables.table_plugin= plugin; |
|
1664 |
}
|
|
1665 |
}
|
|
1666 |
||
1667 |
if (ha_recover(0)) |
|
1668 |
{
|
|
1669 |
unireg_abort(1); |
|
1670 |
}
|
|
1671 |
||
1672 |
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
|
|
1673 |
if (locked_in_memory && !getuid()) |
|
1674 |
{
|
|
1675 |
if (setreuid((uid_t)-1, 0) == -1) |
|
1676 |
{ // this should never happen |
|
1677 |
sql_perror("setreuid"); |
|
1678 |
unireg_abort(1); |
|
1679 |
}
|
|
1680 |
if (mlockall(MCL_CURRENT)) |
|
1681 |
{
|
|
1682 |
if (global_system_variables.log_warnings) |
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1683 |
errmsg_printf(ERRMSG_LVL_WARN, _("Failed to lock memory. Errno: %d\n"),errno); |
1
by brian
clean slate |
1684 |
locked_in_memory= 0; |
1685 |
}
|
|
1686 |
if (user_info) |
|
574.2.1
by ysano
Rename mysql to drizzle. |
1687 |
set_user(drizzled_user, user_info); |
1
by brian
clean slate |
1688 |
}
|
1689 |
else
|
|
1690 |
#endif
|
|
1691 |
locked_in_memory=0; |
|
1692 |
||
1693 |
init_update_queries(); |
|
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
1694 |
return(0); |
1
by brian
clean slate |
1695 |
}
|
1696 |
||
1697 |
||
1698 |
int main(int argc, char **argv) |
|
1699 |
{
|
|
236.1.60
by Monty Taylor
Another stab at protecting NLS stuff. |
1700 |
#if defined(ENABLE_NLS)
|
1701 |
# if defined(HAVE_LOCALE_H)
|
|
202.3.8
by Monty Taylor
Actually turn gettext on... |
1702 |
setlocale(LC_ALL, ""); |
236.1.60
by Monty Taylor
Another stab at protecting NLS stuff. |
1703 |
# endif
|
202.3.8
by Monty Taylor
Actually turn gettext on... |
1704 |
bindtextdomain("drizzle", LOCALEDIR); |
1705 |
textdomain("drizzle"); |
|
236.1.60
by Monty Taylor
Another stab at protecting NLS stuff. |
1706 |
#endif
|
202.3.8
by Monty Taylor
Actually turn gettext on... |
1707 |
|
1
by brian
clean slate |
1708 |
MY_INIT(argv[0]); // init my_sys library & pthreads |
1709 |
/* nothing should come before this line ^^^ */
|
|
1710 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1711 |
/* Set signal used to kill Drizzle */
|
1
by brian
clean slate |
1712 |
#if defined(SIGUSR2)
|
1713 |
thr_kill_signal= thd_lib_detected == THD_LIB_LT ? SIGINT : SIGUSR2; |
|
1714 |
#else
|
|
1715 |
thr_kill_signal= SIGINT; |
|
1716 |
#endif
|
|
1717 |
||
1718 |
#ifdef _CUSTOMSTARTUPCONFIG_
|
|
1719 |
if (_cust_check_startup()) |
|
1720 |
{
|
|
1721 |
/ * _cust_check_startup will report startup failure error * / |
|
1722 |
exit(1); |
|
1723 |
}
|
|
1724 |
#endif
|
|
1725 |
||
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
1726 |
if (init_common_variables(DRIZZLE_CONFIG_NAME, |
1
by brian
clean slate |
1727 |
argc, argv, load_default_groups)) |
1728 |
unireg_abort(1); // Will do exit |
|
1729 |
||
1730 |
init_signals(); |
|
5
by Brian Aker
Removed my_pthread_setprio() |
1731 |
|
929.1.6
by Brian Aker
Pushing thread attribute for threads down to engine. |
1732 |
#ifdef TODO_MOVE_OUT_TO_SCHEDULER_API
|
900
by Brian Aker
Creating signal handler plugin. |
1733 |
pthread_attr_setstacksize(&connection_attrib, my_thread_stack_size); |
161
by Brian Aker
I had removed most of the pthread_setschedparam() calls a bit ago. This |
1734 |
|
1
by brian
clean slate |
1735 |
#ifdef HAVE_PTHREAD_ATTR_GETSTACKSIZE
|
1736 |
{
|
|
1737 |
/* Retrieve used stack size; Needed for checking stack overflows */
|
|
1738 |
size_t stack_size= 0; |
|
1739 |
pthread_attr_getstacksize(&connection_attrib, &stack_size); |
|
1740 |
/* We must check if stack_size = 0 as Solaris 2.9 can return 0 here */
|
|
1741 |
if (stack_size && stack_size < my_thread_stack_size) |
|
1742 |
{
|
|
1743 |
if (global_system_variables.log_warnings) |
|
298
by Brian Aker
ulong conversion. |
1744 |
{
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1745 |
errmsg_printf(ERRMSG_LVL_WARN, _("Asked for %"PRIu64" thread stack, " |
629.2.7
by Monty Taylor
Fixed a couple of memory buffer size issues. |
1746 |
"but got %"PRIu64), |
1747 |
(uint64_t)my_thread_stack_size, |
|
1748 |
(uint64_t)stack_size); |
|
298
by Brian Aker
ulong conversion. |
1749 |
}
|
1
by brian
clean slate |
1750 |
my_thread_stack_size= stack_size; |
1751 |
}
|
|
1752 |
}
|
|
1753 |
#endif
|
|
929.1.6
by Brian Aker
Pushing thread attribute for threads down to engine. |
1754 |
#endif
|
1
by brian
clean slate |
1755 |
|
1756 |
select_thread=pthread_self(); |
|
1757 |
select_thread_in_use=1; |
|
1758 |
||
1759 |
/*
|
|
1760 |
We have enough space for fiddling with the argv, continue
|
|
1761 |
*/
|
|
575.4.1
by ysano
Rename mysql to drizzle. |
1762 |
check_data_home(drizzle_real_data_home); |
575.4.6
by Monty Taylor
Removed my_getwd. |
1763 |
if (chdir(drizzle_real_data_home) && !opt_help) |
1
by brian
clean slate |
1764 |
unireg_abort(1); /* purecov: inspected */ |
575.4.3
by ysano
Rename mysql to drizzle. |
1765 |
drizzle_data_home= drizzle_data_home_buff; |
575.4.1
by ysano
Rename mysql to drizzle. |
1766 |
drizzle_data_home[0]=FN_CURLIB; // all paths are relative from here |
1767 |
drizzle_data_home[1]=0; |
|
1768 |
drizzle_data_home_len= 2; |
|
1
by brian
clean slate |
1769 |
|
574.2.1
by ysano
Rename mysql to drizzle. |
1770 |
if ((user_info= check_user(drizzled_user))) |
1
by brian
clean slate |
1771 |
{
|
1772 |
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
|
|
1773 |
if (locked_in_memory) // getuid() == 0 here |
|
1774 |
set_effective_user(user_info); |
|
1775 |
else
|
|
1776 |
#endif
|
|
574.2.1
by ysano
Rename mysql to drizzle. |
1777 |
set_user(drizzled_user, user_info); |
1
by brian
clean slate |
1778 |
}
|
1779 |
||
798.2.28
by Brian Aker
More pulling of code... master_pos function code removed. |
1780 |
if (server_id == 0) |
1
by brian
clean slate |
1781 |
{
|
1782 |
server_id= 1; |
|
1783 |
}
|
|
1784 |
||
1785 |
if (init_server_components()) |
|
1786 |
unireg_abort(1); |
|
1787 |
||
1788 |
network_init(); |
|
1789 |
||
722.2.12
by Monty Taylor
Removed assert(0); Added function ptr in libdrizzle. |
1790 |
safe_read_error_hook= safe_read_error_impl; |
1
by brian
clean slate |
1791 |
|
1792 |
/*
|
|
1793 |
init signals & alarm
|
|
1794 |
After this we can't quit by a simple unireg_abort
|
|
1795 |
*/
|
|
1796 |
error_handler_hook= my_message_sql; |
|
1797 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
1798 |
if (drizzle_rm_tmp_tables() || my_tz_init((Session *)0, default_tz_name)) |
1
by brian
clean slate |
1799 |
{
|
909
by Brian Aker
Remove the need for unireg init |
1800 |
abort_loop= true; |
1
by brian
clean slate |
1801 |
select_thread_in_use=0; |
900
by Brian Aker
Creating signal handler plugin. |
1802 |
(void) pthread_kill(signal_thread, SIGTERM); |
1
by brian
clean slate |
1803 |
|
914.2.1
by Brian Aker
Cleanup pid handler. |
1804 |
(void) unlink(pidfile_name); // Not needed anymore |
1
by brian
clean slate |
1805 |
|
1806 |
exit(1); |
|
1807 |
}
|
|
1808 |
||
1809 |
init_status_vars(); |
|
1810 |
/*
|
|
1811 |
init_slave() must be called after the thread keys are created.
|
|
1812 |
Some parts of the code (e.g. SHOW STATUS LIKE 'slave_running' and other
|
|
1813 |
places) assume that active_mi != 0, so let's fail if it's 0 (out of
|
|
1814 |
memory); a message has already been printed.
|
|
1815 |
*/
|
|
1816 |
||
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1817 |
errmsg_printf(ERRMSG_LVL_INFO, _(ER(ER_STARTUP)),my_progname,server_version, |
574.2.1
by ysano
Rename mysql to drizzle. |
1818 |
"", drizzled_port, COMPILATION_COMMENT); |
11
by Brian Aker
Removing old UNIX socket bits |
1819 |
|
1820 |
||
1821 |
handle_connections_sockets(); |
|
1
by brian
clean slate |
1822 |
/* (void) pthread_attr_destroy(&connection_attrib); */
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1823 |
|
1
by brian
clean slate |
1824 |
|
1825 |
(void) pthread_mutex_lock(&LOCK_thread_count); |
|
1826 |
select_thread_in_use=0; // For close_connections |
|
1827 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
1828 |
(void) pthread_cond_broadcast(&COND_thread_count); |
|
1829 |
||
1830 |
/* Wait until cleanup is done */
|
|
1831 |
(void) pthread_mutex_lock(&LOCK_thread_count); |
|
1832 |
while (!ready_to_exit) |
|
1833 |
pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); |
|
1834 |
(void) pthread_mutex_unlock(&LOCK_thread_count); |
|
1835 |
||
1836 |
clean_up(1); |
|
907.3.5
by Monty Taylor
Fixed new 64-bit caused solaris warnings. |
1837 |
clean_up_mutexes(); |
1838 |
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); |
|
1839 |
return 0; |
|
1
by brian
clean slate |
1840 |
}
|
1841 |
||
1842 |
||
1843 |
/**
|
|
1844 |
Create new thread to handle incoming connection.
|
|
1845 |
||
1846 |
This function will create new thread to handle the incoming
|
|
1847 |
connection. If there are idle cached threads one will be used.
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1848 |
'session' will be pushed into 'threads'.
|
1
by brian
clean slate |
1849 |
|
1850 |
In single-threaded mode (\#define ONE_THREAD) connection will be
|
|
1851 |
handled inside this function.
|
|
1852 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1853 |
@param[in,out] session Thread handle of future thread.
|
1
by brian
clean slate |
1854 |
*/
|
1855 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1856 |
static void create_new_thread(Session *session) |
1
by brian
clean slate |
1857 |
{
|
910.5.3
by Monty Taylor
Rolled back the atomic2 patch. |
1858 |
pthread_mutex_lock(&LOCK_thread_count); |
1
by brian
clean slate |
1859 |
|
1860 |
++connection_count; |
|
1861 |
||
1862 |
if (connection_count > max_used_connections) |
|
1863 |
max_used_connections= connection_count; |
|
1864 |
||
1865 |
/*
|
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1866 |
The initialization of thread_id is done in create_embedded_session() for
|
1
by brian
clean slate |
1867 |
the embedded library.
|
1868 |
TODO: refactor this to avoid code duplication there
|
|
1869 |
*/
|
|
910.5.3
by Monty Taylor
Rolled back the atomic2 patch. |
1870 |
session->thread_id= session->variables.pseudo_thread_id= thread_id++; |
1
by brian
clean slate |
1871 |
|
859
by Brian Aker
Fix for error when thread/whatever can not be created on connection. |
1872 |
/*
|
1873 |
If we error on creation we drop the connection and delete the session.
|
|
1874 |
*/
|
|
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
1875 |
session_list.append(session); |
859
by Brian Aker
Fix for error when thread/whatever can not be created on connection. |
1876 |
if (thread_scheduler.add_connection(session)) |
1877 |
{
|
|
1878 |
char error_message_buff[DRIZZLE_ERRMSG_SIZE]; |
|
1879 |
||
1880 |
session->killed= Session::KILL_CONNECTION; // Safety |
|
1881 |
||
1882 |
statistic_increment(aborted_connects, &LOCK_status); |
|
1883 |
||
1884 |
/* Can't use my_error() since store_globals has not been called. */
|
|
1885 |
snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), 1); /* TODO replace will better error message */ |
|
1886 |
net_send_error(session, ER_CANT_CREATE_THREAD, error_message_buff); |
|
942.2.4
by Brian Aker
One execution path for unlink_session() |
1887 |
unlink_session(session); |
859
by Brian Aker
Fix for error when thread/whatever can not be created on connection. |
1888 |
}
|
1
by brian
clean slate |
1889 |
}
|
1890 |
||
1891 |
||
1892 |
/* Handle new connections and spawn new process to handle them */
|
|
1893 |
||
11
by Brian Aker
Removing old UNIX socket bits |
1894 |
void handle_connections_sockets() |
1
by brian
clean slate |
1895 |
{
|
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
1896 |
int x; |
268
by Brian Aker
Merging up a bunch of assert() and cleanup of my_sock typedef |
1897 |
int sock,new_sock; |
482
by Brian Aker
Remove uint. |
1898 |
uint32_t error_count=0; |
520.1.22
by Brian Aker
Second pass of thd cleanup |
1899 |
Session *session; |
1
by brian
clean slate |
1900 |
struct sockaddr_storage cAddr; |
1901 |
||
1902 |
while (!abort_loop) |
|
1903 |
{
|
|
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
1904 |
int number_of; |
1905 |
||
1906 |
if ((number_of= poll(fds, pollfd_count, -1)) == -1) |
|
1
by brian
clean slate |
1907 |
{
|
429
by Monty Taylor
Removed SOCKET redefines. |
1908 |
if (errno != EINTR) |
1
by brian
clean slate |
1909 |
{
|
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
1910 |
if (!select_errors++ && !abort_loop) /* purecov: inspected */ |
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
1911 |
errmsg_printf(ERRMSG_LVL_ERROR, _("drizzled: Got error %d from select"), |
429
by Monty Taylor
Removed SOCKET redefines. |
1912 |
errno); /* purecov: inspected */ |
1
by brian
clean slate |
1913 |
}
|
1914 |
continue; |
|
1915 |
}
|
|
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
1916 |
if (number_of == 0) |
1917 |
continue; |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1918 |
|
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
1919 |
#ifdef FIXME_IF_WE_WERE_KEEPING_THIS
|
1920 |
assert(number_of > 1); /* Not handling this at the moment */ |
|
1921 |
#endif
|
|
1922 |
||
1
by brian
clean slate |
1923 |
if (abort_loop) |
1924 |
{
|
|
1925 |
break; |
|
1926 |
}
|
|
1927 |
||
229
by Brian Aker
This is the second pass through the code. Mainly to get the socket loop |
1928 |
for (x= 0, sock= -1; x < pollfd_count; x++) |
1929 |
{
|
|
1930 |
if (fds[x].revents == POLLIN) |
|
1931 |
{
|
|
1932 |
sock= fds[x].fd; |
|
1933 |
break; |
|
1934 |
}
|
|
1935 |
}
|
|
1936 |
assert(sock != -1); |
|
1
by brian
clean slate |
1937 |
|
482
by Brian Aker
Remove uint. |
1938 |
for (uint32_t retry=0; retry < MAX_ACCEPT_RETRY; retry++) |
1
by brian
clean slate |
1939 |
{
|
942.1.6
by Monty Taylor
socklen_t is POSIX. We don't need to check for it. |
1940 |
socklen_t length= sizeof(struct sockaddr_storage); |
1
by brian
clean slate |
1941 |
new_sock= accept(sock, (struct sockaddr *)(&cAddr), |
1942 |
&length); |
|
429
by Monty Taylor
Removed SOCKET redefines. |
1943 |
if (new_sock != -1 || (errno != EINTR && errno != EAGAIN)) |
693
by Brian Aker
Cleaning up session class. |
1944 |
break; |
1
by brian
clean slate |
1945 |
}
|
228
by Brian Aker
First pass on socket cleanup. |
1946 |
|
1947 |
||
268
by Brian Aker
Merging up a bunch of assert() and cleanup of my_sock typedef |
1948 |
if (new_sock == -1) |
1
by brian
clean slate |
1949 |
{
|
1950 |
if ((error_count++ & 255) == 0) // This can happen often |
|
693
by Brian Aker
Cleaning up session class. |
1951 |
sql_perror("Error in accept"); |
429
by Monty Taylor
Removed SOCKET redefines. |
1952 |
if (errno == ENFILE || errno == EMFILE) |
693
by Brian Aker
Cleaning up session class. |
1953 |
sleep(1); // Give other threads some time |
1
by brian
clean slate |
1954 |
continue; |
1955 |
}
|
|
1956 |
||
1957 |
{
|
|
942.1.6
by Monty Taylor
socklen_t is POSIX. We don't need to check for it. |
1958 |
socklen_t dummyLen; |
1
by brian
clean slate |
1959 |
struct sockaddr_storage dummy; |
1960 |
dummyLen = sizeof(dummy); |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
1961 |
if ( getsockname(new_sock,(struct sockaddr *)&dummy, |
292
by Brian Aker
Merge |
1962 |
(socklen_t *)&dummyLen) < 0 ) |
1
by brian
clean slate |
1963 |
{
|
292
by Brian Aker
Merge |
1964 |
sql_perror("Error on new connection socket"); |
1965 |
(void) shutdown(new_sock, SHUT_RDWR); |
|
293
by Brian Aker
Merge + closesocket() fix |
1966 |
(void) close(new_sock); |
292
by Brian Aker
Merge |
1967 |
continue; |
287.1.1
by Andrew Garner
extended check for bad connections after accept |
1968 |
}
|
292
by Brian Aker
Merge |
1969 |
dummyLen = sizeof(dummy); |
1970 |
if ( getpeername(new_sock, (struct sockaddr *)&dummy, |
|
1971 |
(socklen_t *)&dummyLen) < 0) |
|
287.1.1
by Andrew Garner
extended check for bad connections after accept |
1972 |
{
|
292
by Brian Aker
Merge |
1973 |
sql_perror("Error on new connection socket"); |
1974 |
(void) shutdown(new_sock, SHUT_RDWR); |
|
293
by Brian Aker
Merge + closesocket() fix |
1975 |
(void) close(new_sock); |
287.1.1
by Andrew Garner
extended check for bad connections after accept |
1976 |
continue; |
1
by brian
clean slate |
1977 |
}
|
1978 |
}
|
|
1979 |
||
1980 |
/*
|
|
1981 |
** Don't allow too many connections
|
|
1982 |
*/
|
|
1983 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1984 |
if (!(session= new Session)) |
1
by brian
clean slate |
1985 |
{
|
1986 |
(void) shutdown(new_sock, SHUT_RDWR); |
|
398.1.10
by Monty Taylor
Actually removed VOID() this time. |
1987 |
close(new_sock); |
1
by brian
clean slate |
1988 |
continue; |
1989 |
}
|
|
840.1.20
by Monty Taylor
Renamed non-prefixed things from libdrizzleclient to drizzleclient. |
1990 |
if (drizzleclient_net_init_sock(&session->net, new_sock, sock == 0)) |
1
by brian
clean slate |
1991 |
{
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
1992 |
delete session; |
1
by brian
clean slate |
1993 |
continue; |
1994 |
}
|
|
1995 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
1996 |
create_new_thread(session); |
1
by brian
clean slate |
1997 |
}
|
1998 |
}
|
|
1999 |
||
2000 |
||
2001 |
/****************************************************************************
|
|
2002 |
Handle start options
|
|
2003 |
******************************************************************************/
|
|
2004 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2005 |
enum options_drizzled |
1
by brian
clean slate |
2006 |
{
|
867
by Brian Aker
Remove dead options. |
2007 |
OPT_ISAM_LOG=256, |
2008 |
OPT_SKIP_NEW, |
|
2009 |
OPT_SOCKET, |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
2010 |
OPT_BIN_LOG, |
1
by brian
clean slate |
2011 |
OPT_BIND_ADDRESS, OPT_PID_FILE, |
2012 |
OPT_FLUSH, OPT_SAFE, |
|
867
by Brian Aker
Remove dead options. |
2013 |
OPT_STORAGE_ENGINE, |
2014 |
OPT_INIT_FILE, |
|
438.1.1
by Brian Aker
First pass of removing historical logging. |
2015 |
OPT_DELAY_KEY_WRITE_ALL, |
856
by Brian Aker
Remove dead code around charset variable/directory. |
2016 |
OPT_DELAY_KEY_WRITE, |
1
by brian
clean slate |
2017 |
OPT_WANT_CORE, |
867
by Brian Aker
Remove dead options. |
2018 |
OPT_MEMLOCK, |
2019 |
OPT_MYISAM_RECOVER, |
|
614
by Brian Aker
Remove filtering (wrong layer, belongs in plugin). |
2020 |
OPT_SERVER_ID, |
867
by Brian Aker
Remove dead options. |
2021 |
OPT_TC_HEURISTIC_RECOVER, |
236.1.40
by Monty Taylor
A few meaningless changes. |
2022 |
OPT_ENGINE_CONDITION_PUSHDOWN, |
1
by brian
clean slate |
2023 |
OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE, |
2024 |
OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, |
|
867
by Brian Aker
Remove dead options. |
2025 |
OPT_DO_PSTACK, |
2026 |
OPT_LOCAL_INFILE, |
|
798.2.18
by Brian Aker
Remove dead COM for BINLOG/REGISTER. |
2027 |
OPT_BACK_LOG, |
1
by brian
clean slate |
2028 |
OPT_CONNECT_TIMEOUT, |
160.1.2
by mark
remove FTPARSER and last remains of full text search |
2029 |
OPT_FLUSH_TIME, |
1
by brian
clean slate |
2030 |
OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE, |
2031 |
OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE, |
|
2032 |
OPT_KEY_CACHE_DIVISION_LIMIT, OPT_KEY_CACHE_AGE_THRESHOLD, |
|
2033 |
OPT_LONG_QUERY_TIME, |
|
2034 |
OPT_LOWER_CASE_TABLE_NAMES, OPT_MAX_ALLOWED_PACKET, |
|
832.2.8
by Mark Atwood
remove sysvar max_connections |
2035 |
OPT_MAX_CONNECT_ERRORS, |
1
by brian
clean slate |
2036 |
OPT_MAX_HEP_TABLE_SIZE, |
245
by Brian Aker
Removed dead variables. |
2037 |
OPT_MAX_JOIN_SIZE, |
1
by brian
clean slate |
2038 |
OPT_MAX_RELAY_LOG_SIZE, OPT_MAX_SORT_LENGTH, |
2039 |
OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS, |
|
2040 |
OPT_MAX_LENGTH_FOR_SORT_DATA, |
|
2041 |
OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE, |
|
2042 |
OPT_MAX_ERROR_COUNT, OPT_MULTI_RANGE_COUNT, OPT_MYISAM_DATA_POINTER_SIZE, |
|
2043 |
OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, |
|
2044 |
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, |
|
2045 |
OPT_MYISAM_USE_MMAP, OPT_MYISAM_REPAIR_THREADS, |
|
2046 |
OPT_MYISAM_STATS_METHOD, |
|
2047 |
OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, |
|
2048 |
OPT_NET_READ_TIMEOUT, OPT_NET_WRITE_TIMEOUT, |
|
2049 |
OPT_PRELOAD_BUFFER_SIZE, |
|
245
by Brian Aker
Removed dead variables. |
2050 |
OPT_RECORD_BUFFER, |
867
by Brian Aker
Remove dead options. |
2051 |
OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, |
2052 |
OPT_DEBUGGING, |
|
1
by brian
clean slate |
2053 |
OPT_SORT_BUFFER, OPT_TABLE_OPEN_CACHE, OPT_TABLE_DEF_CACHE, |
2054 |
OPT_TMP_TABLE_SIZE, OPT_THREAD_STACK, |
|
2055 |
OPT_WAIT_TIMEOUT, |
|
80.2.1
by mark
remove handling of suspicious UDFs |
2056 |
OPT_RANGE_ALLOC_BLOCK_SIZE, |
1
by brian
clean slate |
2057 |
OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, |
2058 |
OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, |
|
2059 |
OPT_OLD_ALTER_TABLE, |
|
2060 |
OPT_GROUP_CONCAT_MAX_LEN, |
|
2061 |
OPT_DEFAULT_COLLATION, |
|
2062 |
OPT_CHARACTER_SET_FILESYSTEM, |
|
2063 |
OPT_LC_TIME_NAMES, |
|
2064 |
OPT_INIT_CONNECT, |
|
2065 |
OPT_DEFAULT_TIME_ZONE, |
|
2066 |
OPT_SYSDATE_IS_NOW, |
|
2067 |
OPT_OPTIMIZER_SEARCH_DEPTH, |
|
868
by Brian Aker
Adding Multi-threaded Scheduler into the system. |
2068 |
OPT_SCHEDULER, |
1
by brian
clean slate |
2069 |
OPT_OPTIMIZER_PRUNE_LEVEL, |
2070 |
OPT_UPDATABLE_VIEWS_WITH_LIMIT, |
|
2071 |
OPT_AUTO_INCREMENT, OPT_AUTO_INCREMENT_OFFSET, |
|
2072 |
OPT_ENABLE_LARGE_PAGES, |
|
2073 |
OPT_TIMED_MUTEXES, |
|
2074 |
OPT_TABLE_LOCK_WAIT_TIMEOUT, |
|
2075 |
OPT_PLUGIN_LOAD, |
|
2076 |
OPT_PLUGIN_DIR, |
|
2077 |
OPT_PORT_OPEN_TIMEOUT, |
|
2078 |
OPT_KEEP_FILES_ON_CREATE, |
|
2079 |
OPT_SECURE_FILE_PRIV, |
|
2080 |
OPT_MIN_EXAMINED_ROW_LIMIT, |
|
867
by Brian Aker
Remove dead options. |
2081 |
OPT_OLD_MODE
|
1
by brian
clean slate |
2082 |
};
|
2083 |
||
2084 |
||
366
by Patrick Galbraith
Ulong conversion |
2085 |
#define LONG_TIMEOUT ((uint32_t) 3600L*24L*365L)
|
1
by brian
clean slate |
2086 |
|
2087 |
struct my_option my_long_options[] = |
|
2088 |
{
|
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2089 |
{"help", '?', N_("Display this help and exit."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2090 |
(char**) &opt_help, (char**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, |
1
by brian
clean slate |
2091 |
0, 0}, |
2092 |
{"auto-increment-increment", OPT_AUTO_INCREMENT, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2093 |
N_("Auto-increment columns are incremented by this"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2094 |
(char**) &global_system_variables.auto_increment_increment, |
819.1.1
by Toru Maesaka
Removed the 16bit limitation of auto_increment_(increment|offset) system variables |
2095 |
(char**) &max_system_variables.auto_increment_increment, 0, GET_ULL, |
2096 |
OPT_ARG, 1, 1, UINT64_MAX, 0, 1, 0 }, |
|
1
by brian
clean slate |
2097 |
{"auto-increment-offset", OPT_AUTO_INCREMENT_OFFSET, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2098 |
N_("Offset added to Auto-increment columns. Used when " |
2099 |
"auto-increment-increment != 1"), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2100 |
(char**) &global_system_variables.auto_increment_offset, |
819.1.1
by Toru Maesaka
Removed the 16bit limitation of auto_increment_(increment|offset) system variables |
2101 |
(char**) &max_system_variables.auto_increment_offset, 0, GET_ULL, OPT_ARG, |
2102 |
1, 1, UINT64_MAX, 0, 1, 0 }, |
|
1
by brian
clean slate |
2103 |
{"basedir", 'b', |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2104 |
N_("Path to installation directory. All paths are usually resolved " |
2105 |
"relative to this."), |
|
574.2.1
by ysano
Rename mysql to drizzle. |
2106 |
(char**) &drizzle_home_ptr, (char**) &drizzle_home_ptr, 0, GET_STR, REQUIRED_ARG, |
1
by brian
clean slate |
2107 |
0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2108 |
{"bind-address", OPT_BIND_ADDRESS, N_("IP address to bind to."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2109 |
(char**) &my_bind_addr_str, (char**) &my_bind_addr_str, 0, GET_STR, |
1
by brian
clean slate |
2110 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
2111 |
{"character-set-filesystem", OPT_CHARACTER_SET_FILESYSTEM, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2112 |
N_("Set the filesystem character set."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2113 |
(char**) &character_set_filesystem_name, |
2114 |
(char**) &character_set_filesystem_name, |
|
1
by brian
clean slate |
2115 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2116 |
{"character-set-server", 'C', |
2117 |
N_("Set the default character set."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2118 |
(char**) &default_character_set_name, (char**) &default_character_set_name, |
1
by brian
clean slate |
2119 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2120 |
{"chroot", 'r', |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2121 |
N_("Chroot drizzled daemon during startup."), |
574.2.1
by ysano
Rename mysql to drizzle. |
2122 |
(char**) &drizzled_chroot, (char**) &drizzled_chroot, 0, GET_STR, REQUIRED_ARG, |
1
by brian
clean slate |
2123 |
0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2124 |
{"collation-server", OPT_DEFAULT_COLLATION, |
2125 |
N_("Set the default collation."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2126 |
(char**) &default_collation_name, (char**) &default_collation_name, |
1
by brian
clean slate |
2127 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2128 |
{"completion-type", OPT_COMPLETION_TYPE, |
2129 |
N_("Default completion type."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2130 |
(char**) &global_system_variables.completion_type, |
619
by Brian Aker
Removed ulong methods from vars. |
2131 |
(char**) &max_system_variables.completion_type, 0, GET_UINT, |
1
by brian
clean slate |
2132 |
REQUIRED_ARG, 0, 0, 2, 0, 1, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2133 |
{"core-file", OPT_WANT_CORE, |
2134 |
N_("Write core on errors."), |
|
2135 |
0, 0, 0, GET_NO_ARG, |
|
1
by brian
clean slate |
2136 |
NO_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2137 |
{"datadir", 'h', |
2138 |
N_("Path to the database root."), |
|
575.4.1
by ysano
Rename mysql to drizzle. |
2139 |
(char**) &drizzle_data_home, |
2140 |
(char**) &drizzle_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
|
1
by brian
clean slate |
2141 |
{"default-storage-engine", OPT_STORAGE_ENGINE, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2142 |
N_("Set the default storage engine (table type) for tables."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2143 |
(char**)&default_storage_engine_str, (char**)&default_storage_engine_str, |
1
by brian
clean slate |
2144 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2145 |
{"default-time-zone", OPT_DEFAULT_TIME_ZONE, |
2146 |
N_("Set the default time zone."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2147 |
(char**) &default_tz_name, (char**) &default_tz_name, |
1
by brian
clean slate |
2148 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2149 |
{"delay-key-write", OPT_DELAY_KEY_WRITE, |
2150 |
N_("Type of DELAY_KEY_WRITE."), |
|
1
by brian
clean slate |
2151 |
0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
2152 |
#ifdef HAVE_STACK_TRACE_ON_SEGV
|
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2153 |
{"enable-pstack", OPT_DO_PSTACK, |
2154 |
N_("Print a symbolic stack trace on failure."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2155 |
(char**) &opt_do_pstack, (char**) &opt_do_pstack, 0, GET_BOOL, NO_ARG, 0, 0, |
1
by brian
clean slate |
2156 |
0, 0, 0, 0}, |
2157 |
#endif /* HAVE_STACK_TRACE_ON_SEGV */ |
|
2158 |
{"engine-condition-pushdown", |
|
2159 |
OPT_ENGINE_CONDITION_PUSHDOWN, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2160 |
N_("Push supported query conditions to the storage engine."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2161 |
(char**) &global_system_variables.engine_condition_pushdown, |
2162 |
(char**) &global_system_variables.engine_condition_pushdown, |
|
520.1.2
by Brian Aker
Disabling ICP, its buggy. |
2163 |
0, GET_BOOL, NO_ARG, false, 0, 0, 0, 0, 0}, |
1
by brian
clean slate |
2164 |
/* See how it's handled in get_one_option() */
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2165 |
{"exit-info", 'T', |
2166 |
N_("Used for debugging; Use at your own risk!"), |
|
2167 |
0, 0, 0, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
|
2168 |
{"flush", OPT_FLUSH, |
|
2169 |
N_("Flush tables to disk between SQL commands."), |
|
2170 |
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, |
|
1
by brian
clean slate |
2171 |
/* We must always support the next option to make scripts like mysqltest
|
2172 |
easier to do */
|
|
2173 |
{"gdb", OPT_DEBUGGING, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2174 |
N_("Set up signals usable for debugging"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2175 |
(char**) &opt_debugging, (char**) &opt_debugging, |
1
by brian
clean slate |
2176 |
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2177 |
{"init-connect", OPT_INIT_CONNECT, |
2178 |
N_("Command(s) that are executed for each new connection"), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2179 |
(char**) &opt_init_connect, (char**) &opt_init_connect, 0, GET_STR_ALLOC, |
1
by brian
clean slate |
2180 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2181 |
{"init-file", OPT_INIT_FILE, |
2182 |
N_("Read SQL commands from this file at startup."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2183 |
(char**) &opt_init_file, (char**) &opt_init_file, 0, GET_STR, REQUIRED_ARG, |
1
by brian
clean slate |
2184 |
0, 0, 0, 0, 0, 0}, |
2185 |
{"language", 'L', |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2186 |
N_("(IGNORED)"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2187 |
(char**) &language_ptr, (char**) &language_ptr, 0, GET_STR, REQUIRED_ARG, |
1
by brian
clean slate |
2188 |
0, 0, 0, 0, 0, 0}, |
2189 |
{"lc-time-names", OPT_LC_TIME_NAMES, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2190 |
N_("Set the language used for the month names and the days of the week."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2191 |
(char**) &lc_time_names_name, |
2192 |
(char**) &lc_time_names_name, |
|
1
by brian
clean slate |
2193 |
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, |
2194 |
{"local-infile", OPT_LOCAL_INFILE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2195 |
N_("Enable/disable LOAD DATA LOCAL INFILE (takes values 1|0)."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2196 |
(char**) &opt_local_infile, |
2197 |
(char**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, |
|
1
by brian
clean slate |
2198 |
1, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2199 |
{"log", 'l', |
2200 |
N_("Log connections and queries to file."), |
|
2201 |
(char**) &opt_logname, |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2202 |
(char**) &opt_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2203 |
{"log-isam", OPT_ISAM_LOG, |
2204 |
N_("Log all MyISAM changes to file."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2205 |
(char**) &myisam_log_filename, (char**) &myisam_log_filename, 0, GET_STR, |
1
by brian
clean slate |
2206 |
OPT_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2207 |
{"log-warnings", 'W', |
2208 |
N_("Log some not critical warnings to the log file."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2209 |
(char**) &global_system_variables.log_warnings, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2210 |
(char**) &max_system_variables.log_warnings, 0, GET_BOOL, OPT_ARG, 1, 0, 0, |
1
by brian
clean slate |
2211 |
0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2212 |
{"memlock", OPT_MEMLOCK, |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2213 |
N_("Lock drizzled in memory."), |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2214 |
(char**) &locked_in_memory, |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2215 |
(char**) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
1
by brian
clean slate |
2216 |
{"myisam-recover", OPT_MYISAM_RECOVER, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2217 |
N_("Syntax: myisam-recover[=option[,option...]], where option can be " |
2218 |
"DEFAULT, BACKUP, FORCE or QUICK."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2219 |
(char**) &myisam_recover_options_str, (char**) &myisam_recover_options_str, 0, |
1
by brian
clean slate |
2220 |
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
2221 |
{"old-alter-table", OPT_OLD_ALTER_TABLE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2222 |
N_("Use old, non-optimized alter table."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2223 |
(char**) &global_system_variables.old_alter_table, |
2224 |
(char**) &max_system_variables.old_alter_table, 0, GET_BOOL, NO_ARG, |
|
1
by brian
clean slate |
2225 |
0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2226 |
{"pid-file", OPT_PID_FILE, |
2227 |
N_("Pid file used by safe_mysqld."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2228 |
(char**) &pidfile_name_ptr, (char**) &pidfile_name_ptr, 0, GET_STR, |
1
by brian
clean slate |
2229 |
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2230 |
{"port", 'P', |
2231 |
N_("Port number to use for connection or 0 for default to, in " |
|
520.4.28
by Monty Taylor
Changed my.cnf to drizzle.cnf and /etc/mysql to /etc/drizzle. |
2232 |
"order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, "
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2233 |
"built-in default (" STRINGIFY_ARG(DRIZZLE_PORT) ")."), |
574.2.1
by ysano
Rename mysql to drizzle. |
2234 |
(char**) &drizzled_port, |
2235 |
(char**) &drizzled_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
|
1
by brian
clean slate |
2236 |
{"port-open-timeout", OPT_PORT_OPEN_TIMEOUT, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2237 |
N_("Maximum time in seconds to wait for the port to become free. " |
2238 |
"(Default: no wait)"), |
|
574.2.1
by ysano
Rename mysql to drizzle. |
2239 |
(char**) &drizzled_port_timeout, |
2240 |
(char**) &drizzled_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2241 |
{"safe-mode", OPT_SAFE, |
2242 |
N_("Skip some optimize stages (for testing)."), |
|
1
by brian
clean slate |
2243 |
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, |
2244 |
{"secure-file-priv", OPT_SECURE_FILE_PRIV, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2245 |
N_("Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files " |
2246 |
"within specified directory"), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2247 |
(char**) &opt_secure_file_priv, (char**) &opt_secure_file_priv, 0, |
1
by brian
clean slate |
2248 |
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
2249 |
{"server-id", OPT_SERVER_ID, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2250 |
N_("Uniquely identifies the server instance in the community of " |
2251 |
"replication partners."), |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2252 |
(char**) &server_id, (char**) &server_id, 0, GET_UINT32, REQUIRED_ARG, 0, 0, 0, |
1
by brian
clean slate |
2253 |
0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2254 |
{"skip-new", OPT_SKIP_NEW, |
2255 |
N_("Don't use new, possible wrong routines."), |
|
1
by brian
clean slate |
2256 |
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, |
2257 |
{"skip-stack-trace", OPT_SKIP_STACK_TRACE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2258 |
N_("Don't print a stack trace on failure."), |
2259 |
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, |
|
1
by brian
clean slate |
2260 |
0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2261 |
{"symbolic-links", 's', |
2262 |
N_("Enable symbolic link support."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2263 |
(char**) &my_use_symdir, (char**) &my_use_symdir, 0, GET_BOOL, NO_ARG, |
1
by brian
clean slate |
2264 |
/*
|
2265 |
The system call realpath() produces warnings under valgrind and
|
|
2266 |
purify. These are not suppressed: instead we disable symlinks
|
|
2267 |
option if compiled with valgrind support.
|
|
2268 |
*/
|
|
2269 |
IF_PURIFY(0,1), 0, 0, 0, 0, 0}, |
|
2270 |
{"temp-pool", OPT_TEMP_POOL, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2271 |
N_("Using this option will cause most temporary files created to use a " |
2272 |
"small set of names, rather than a unique name for each new file."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2273 |
(char**) &use_temp_pool, (char**) &use_temp_pool, 0, GET_BOOL, NO_ARG, 1, |
1
by brian
clean slate |
2274 |
0, 0, 0, 0, 0}, |
2275 |
{"timed_mutexes", OPT_TIMED_MUTEXES, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2276 |
N_("Specify whether to time mutexes (only InnoDB mutexes are currently " |
2277 |
"supported)"), |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
2278 |
(char**) &timed_mutexes, (char**) &timed_mutexes, 0, GET_BOOL, NO_ARG, 0, |
1
by brian
clean slate |
2279 |
0, 0, 0, 0, 0}, |
2280 |
{"tmpdir", 't', |
|
680
by Brian Aker
Remove locks around temp tables for searching tmp directory path. |
2281 |
N_("Path for temporary files."), |
575.4.3
by ysano
Rename mysql to drizzle. |
2282 |
(char**) &opt_drizzle_tmpdir, |
2283 |
(char**) &opt_drizzle_tmpdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
|
1
by brian
clean slate |
2284 |
{"transaction-isolation", OPT_TX_ISOLATION, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2285 |
N_("Default transaction isolation level."), |
2286 |
0, 0, 0, GET_STR, REQUIRED_ARG, 0, |
|
1
by brian
clean slate |
2287 |
0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2288 |
{"user", 'u', |
574.2.1
by ysano
Rename mysql to drizzle. |
2289 |
N_("Run drizzled daemon as user."), |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2290 |
0, 0, 0, GET_STR, REQUIRED_ARG, |
1
by brian
clean slate |
2291 |
0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2292 |
{"version", 'V', |
2293 |
N_("Output version information and exit."), |
|
2294 |
0, 0, 0, GET_NO_ARG, |
|
1
by brian
clean slate |
2295 |
NO_ARG, 0, 0, 0, 0, 0, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2296 |
{"back_log", OPT_BACK_LOG, |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2297 |
N_("The number of outstanding connection requests Drizzle can have. This " |
2298 |
"comes into play when the main Drizzle thread gets very many connection "
|
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2299 |
"requests in a very short time."), |
626
by Brian Aker
More of the same (ulong/64) |
2300 |
(char**) &back_log, (char**) &back_log, 0, GET_UINT, |
1
by brian
clean slate |
2301 |
REQUIRED_ARG, 50, 1, 65535, 0, 1, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2302 |
{ "bulk_insert_buffer_size", OPT_BULK_INSERT_BUFFER_SIZE, |
672.1.3
by Andrew Hutchings
Minor string fixes (mainly US English spelling and typos) |
2303 |
N_("Size of tree cache used in bulk insert optimization. Note that this is " |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2304 |
"a limit per thread!"), |
2305 |
(char**) &global_system_variables.bulk_insert_buff_size, |
|
2306 |
(char**) &max_system_variables.bulk_insert_buff_size, |
|
619
by Brian Aker
Removed ulong methods from vars. |
2307 |
0, GET_ULL, REQUIRED_ARG, 8192*1024, 0, ULONG_MAX, 0, 1, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2308 |
{ "connect_timeout", OPT_CONNECT_TIMEOUT, |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2309 |
N_("The number of seconds the drizzled server is waiting for a connect " |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2310 |
"packet before responding with 'Bad handshake'."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2311 |
(char**) &connect_timeout, (char**) &connect_timeout, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2312 |
0, GET_UINT32, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 }, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2313 |
{ "div_precision_increment", OPT_DIV_PRECINCREMENT, |
2314 |
N_("Precision of the result of '/' operator will be increased on that " |
|
2315 |
"value."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2316 |
(char**) &global_system_variables.div_precincrement, |
619
by Brian Aker
Removed ulong methods from vars. |
2317 |
(char**) &max_system_variables.div_precincrement, 0, GET_UINT, |
1
by brian
clean slate |
2318 |
REQUIRED_ARG, 4, 0, DECIMAL_MAX_SCALE, 0, 0, 0}, |
2319 |
{ "group_concat_max_len", OPT_GROUP_CONCAT_MAX_LEN, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2320 |
N_("The maximum length of the result of function group_concat."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2321 |
(char**) &global_system_variables.group_concat_max_len, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2322 |
(char**) &max_system_variables.group_concat_max_len, 0, GET_UINT64, |
1
by brian
clean slate |
2323 |
REQUIRED_ARG, 1024, 4, ULONG_MAX, 0, 1, 0}, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2324 |
{ "join_buffer_size", OPT_JOIN_BUFF_SIZE, |
2325 |
N_("The size of the buffer that is used for full joins."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2326 |
(char**) &global_system_variables.join_buff_size, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2327 |
(char**) &max_system_variables.join_buff_size, 0, GET_UINT64, |
1
by brian
clean slate |
2328 |
REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ULONG_MAX, |
2329 |
MALLOC_OVERHEAD, IO_SIZE, 0}, |
|
2330 |
{"keep_files_on_create", OPT_KEEP_FILES_ON_CREATE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2331 |
N_("Don't overwrite stale .MYD and .MYI even if no directory is specified."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2332 |
(char**) &global_system_variables.keep_files_on_create, |
2333 |
(char**) &max_system_variables.keep_files_on_create, |
|
1
by brian
clean slate |
2334 |
0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, |
2335 |
{"key_buffer_size", OPT_KEY_BUFFER_SIZE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2336 |
N_("The size of the buffer used for index blocks for MyISAM tables. " |
2337 |
"Increase this to get better index handling (for all reads and multiple "
|
|
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2338 |
"writes) to as much as you can afford;"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2339 |
(char**) &dflt_key_cache_var.param_buff_size, |
2340 |
(char**) 0, |
|
1
by brian
clean slate |
2341 |
0, (GET_ULL | GET_ASK_ADDR), |
2342 |
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, SIZE_T_MAX, MALLOC_OVERHEAD, |
|
2343 |
IO_SIZE, 0}, |
|
2344 |
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2345 |
N_("This characterizes the number of hits a hot block has to be untouched " |
2346 |
"until it is considered aged enough to be downgraded to a warm block. "
|
|
2347 |
"This specifies the percentage ratio of that number of hits to the "
|
|
2348 |
"total number of blocks in key cache"), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2349 |
(char**) &dflt_key_cache_var.param_age_threshold, |
2350 |
(char**) 0, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2351 |
0, (GET_UINT32 | GET_ASK_ADDR), REQUIRED_ARG, |
1
by brian
clean slate |
2352 |
300, 100, ULONG_MAX, 0, 100, 0}, |
2353 |
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2354 |
N_("The default size of key cache blocks"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2355 |
(char**) &dflt_key_cache_var.param_block_size, |
2356 |
(char**) 0, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2357 |
0, (GET_UINT32 | GET_ASK_ADDR), REQUIRED_ARG, |
1
by brian
clean slate |
2358 |
KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0}, |
2359 |
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2360 |
N_("The minimum percentage of warm blocks in key cache"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2361 |
(char**) &dflt_key_cache_var.param_division_limit, |
2362 |
(char**) 0, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2363 |
0, (GET_UINT32 | GET_ASK_ADDR) , REQUIRED_ARG, 100, |
1
by brian
clean slate |
2364 |
1, 100, 0, 1, 0}, |
2365 |
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2366 |
N_("Max packetlength to send/receive from to server."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2367 |
(char**) &global_system_variables.max_allowed_packet, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2368 |
(char**) &max_system_variables.max_allowed_packet, 0, GET_UINT32, |
1
by brian
clean slate |
2369 |
REQUIRED_ARG, 1024*1024L, 1024, 1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, |
2370 |
{"max_connect_errors", OPT_MAX_CONNECT_ERRORS, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2371 |
N_("If there is more than this number of interrupted connections from a " |
2372 |
"host this host will be blocked from further connections."), |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2373 |
(char**) &max_connect_errors, (char**) &max_connect_errors, 0, GET_UINT64, |
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2374 |
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ULONG_MAX, 0, 1, 0}, |
1
by brian
clean slate |
2375 |
{"max_error_count", OPT_MAX_ERROR_COUNT, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2376 |
N_("Max number of errors/warnings to store for a statement."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2377 |
(char**) &global_system_variables.max_error_count, |
2378 |
(char**) &max_system_variables.max_error_count, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2379 |
0, GET_UINT64, REQUIRED_ARG, DEFAULT_ERROR_COUNT, 0, 65535, 0, 1, 0}, |
1
by brian
clean slate |
2380 |
{"max_heap_table_size", OPT_MAX_HEP_TABLE_SIZE, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2381 |
N_("Don't allow creation of heap tables bigger than this."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2382 |
(char**) &global_system_variables.max_heap_table_size, |
2383 |
(char**) &max_system_variables.max_heap_table_size, 0, GET_ULL, |
|
1
by brian
clean slate |
2384 |
REQUIRED_ARG, 16*1024*1024L, 16384, MAX_MEM_TABLE_SIZE, |
2385 |
MALLOC_OVERHEAD, 1024, 0}, |
|
2386 |
{"max_join_size", OPT_MAX_JOIN_SIZE, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2387 |
N_("Joins that are probably going to read more than max_join_size records " |
2388 |
"return an error."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2389 |
(char**) &global_system_variables.max_join_size, |
2390 |
(char**) &max_system_variables.max_join_size, 0, GET_HA_ROWS, REQUIRED_ARG, |
|
365.2.8
by Monty Taylor
More MAX macros. |
2391 |
INT32_MAX, 1, INT32_MAX, 0, 1, 0}, |
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2392 |
{"max_length_for_sort_data", OPT_MAX_LENGTH_FOR_SORT_DATA, |
2393 |
N_("Max number of bytes in sorted records."), |
|
2394 |
(char**) &global_system_variables.max_length_for_sort_data, |
|
615
by Brian Aker
Added 32bit system variable support |
2395 |
(char**) &max_system_variables.max_length_for_sort_data, 0, GET_ULL, |
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2396 |
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, |
1
by brian
clean slate |
2397 |
{ "max_seeks_for_key", OPT_MAX_SEEKS_FOR_KEY, |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2398 |
N_("Limit assumed max number of seeks when looking up rows based on a key"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2399 |
(char**) &global_system_variables.max_seeks_for_key, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2400 |
(char**) &max_system_variables.max_seeks_for_key, 0, GET_UINT64, |
1
by brian
clean slate |
2401 |
REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0 }, |
2402 |
{"max_sort_length", OPT_MAX_SORT_LENGTH, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2403 |
N_("The number of bytes to use when sorting BLOB or TEXT values " |
2404 |
"(only the first max_sort_length bytes of each value are used; the "
|
|
2405 |
"rest are ignored)."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2406 |
(char**) &global_system_variables.max_sort_length, |
937.2.9
by Stewart Smith
max_sort_length is GET_SIZE not GET_UINT. as sizeof(uint32_t)!=sizeof(size_t) on solaris sparc 64bit. |
2407 |
(char**) &max_system_variables.max_sort_length, 0, GET_SIZE, |
1
by brian
clean slate |
2408 |
REQUIRED_ARG, 1024, 4, 8192*1024L, 0, 1, 0}, |
2409 |
{"max_tmp_tables", OPT_MAX_TMP_TABLES, |
|
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2410 |
N_("Maximum number of temporary tables a client can keep open at a time."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2411 |
(char**) &global_system_variables.max_tmp_tables, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2412 |
(char**) &max_system_variables.max_tmp_tables, 0, GET_UINT64, |
1
by brian
clean slate |
2413 |
REQUIRED_ARG, 32, 1, ULONG_MAX, 0, 1, 0}, |
2414 |
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2415 |
N_("After this many write locks, allow some read locks to run in between."), |
622.1.1
by Brian Aker
32bit fixes around vars |
2416 |
(char**) &max_write_lock_count, (char**) &max_write_lock_count, 0, GET_ULL, |
1
by brian
clean slate |
2417 |
REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0}, |
2418 |
{"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2419 |
N_("Don't log queries which examine less than min_examined_row_limit " |
2420 |
"rows to file."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2421 |
(char**) &global_system_variables.min_examined_row_limit, |
619
by Brian Aker
Removed ulong methods from vars. |
2422 |
(char**) &max_system_variables.min_examined_row_limit, 0, GET_ULL, |
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2423 |
REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0}, |
1
by brian
clean slate |
2424 |
{"myisam_stats_method", OPT_MYISAM_STATS_METHOD, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2425 |
N_("Specifies how MyISAM index statistics collection code should threat " |
2426 |
"NULLs. Possible values of name are 'nulls_unequal' "
|
|
2427 |
"(default behavior), "
|
|
2428 |
"'nulls_equal' (emulate MySQL 4.0 behavior), and 'nulls_ignored'."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2429 |
(char**) &myisam_stats_method_str, (char**) &myisam_stats_method_str, 0, |
1
by brian
clean slate |
2430 |
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
2431 |
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2432 |
N_("Buffer length for TCP/IP and socket communication."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2433 |
(char**) &global_system_variables.net_buffer_length, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2434 |
(char**) &max_system_variables.net_buffer_length, 0, GET_UINT32, |
1
by brian
clean slate |
2435 |
REQUIRED_ARG, 16384, 1024, 1024*1024L, 0, 1024, 0}, |
2436 |
{"net_read_timeout", OPT_NET_READ_TIMEOUT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2437 |
N_("Number of seconds to wait for more data from a connection before " |
2438 |
"aborting the read."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2439 |
(char**) &global_system_variables.net_read_timeout, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2440 |
(char**) &max_system_variables.net_read_timeout, 0, GET_UINT32, |
1
by brian
clean slate |
2441 |
REQUIRED_ARG, NET_READ_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, |
2442 |
{"net_retry_count", OPT_NET_RETRY_COUNT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2443 |
N_("If a read on a communication port is interrupted, retry this many " |
2444 |
"times before giving up."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2445 |
(char**) &global_system_variables.net_retry_count, |
2446 |
(char**) &max_system_variables.net_retry_count,0, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2447 |
GET_UINT32, REQUIRED_ARG, MYSQLD_NET_RETRY_COUNT, 1, ULONG_MAX, 0, 1, 0}, |
1
by brian
clean slate |
2448 |
{"net_write_timeout", OPT_NET_WRITE_TIMEOUT, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2449 |
N_("Number of seconds to wait for a block to be written to a connection " |
2450 |
"before aborting the write."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2451 |
(char**) &global_system_variables.net_write_timeout, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2452 |
(char**) &max_system_variables.net_write_timeout, 0, GET_UINT32, |
1
by brian
clean slate |
2453 |
REQUIRED_ARG, NET_WRITE_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0}, |
2454 |
{"optimizer_prune_level", OPT_OPTIMIZER_PRUNE_LEVEL, |
|
619
by Brian Aker
Removed ulong methods from vars. |
2455 |
N_("Controls the heuristic(s) applied during query optimization to prune " |
2456 |
"less-promising partial plans from the optimizer search space. Meaning: "
|
|
2457 |
"false - do not apply any heuristic, thus perform exhaustive search; "
|
|
2458 |
"true - prune plans based on number of retrieved rows."), |
|
2459 |
(char**) &global_system_variables.optimizer_prune_level, |
|
2460 |
(char**) &max_system_variables.optimizer_prune_level, |
|
2461 |
0, GET_BOOL, OPT_ARG, 1, 0, 1, 0, 1, 0}, |
|
1
by brian
clean slate |
2462 |
{"optimizer_search_depth", OPT_OPTIMIZER_SEARCH_DEPTH, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2463 |
N_("Maximum depth of search performed by the query optimizer. Values " |
2464 |
"larger than the number of relations in a query result in better query "
|
|
2465 |
"plans, but take longer to compile a query. Smaller values than the "
|
|
2466 |
"number of tables in a relation result in faster optimization, but may "
|
|
2467 |
"produce very bad query plans. If set to 0, the system will "
|
|
2468 |
"automatically pick a reasonable value; if set to MAX_TABLES+2, the "
|
|
2469 |
"optimizer will switch to the original find_best (used for "
|
|
2470 |
"testing/comparison)."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2471 |
(char**) &global_system_variables.optimizer_search_depth, |
2472 |
(char**) &max_system_variables.optimizer_search_depth, |
|
619
by Brian Aker
Removed ulong methods from vars. |
2473 |
0, GET_UINT, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0}, |
1
by brian
clean slate |
2474 |
{"plugin_dir", OPT_PLUGIN_DIR, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2475 |
N_("Directory for plugins."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2476 |
(char**) &opt_plugin_dir_ptr, (char**) &opt_plugin_dir_ptr, 0, |
1
by brian
clean slate |
2477 |
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
2478 |
{"plugin_load", OPT_PLUGIN_LOAD, |
|
573.1.3
by moriyoshi
Fix description for --plugin_load |
2479 |
N_("Optional colon (or semicolon) separated list of plugins to load," |
2480 |
"where each plugin is identified by the name of the shared library. "
|
|
2481 |
"[for example: --plugin_load=libmd5udf.so:libauth_pam.so]"), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2482 |
(char**) &opt_plugin_load, (char**) &opt_plugin_load, 0, |
1
by brian
clean slate |
2483 |
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
2484 |
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2485 |
N_("The size of the buffer that is allocated when preloading indexes"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2486 |
(char**) &global_system_variables.preload_buff_size, |
619
by Brian Aker
Removed ulong methods from vars. |
2487 |
(char**) &max_system_variables.preload_buff_size, 0, GET_ULL, |
1
by brian
clean slate |
2488 |
REQUIRED_ARG, 32*1024L, 1024, 1024*1024*1024L, 0, 1, 0}, |
2489 |
{"query_alloc_block_size", OPT_QUERY_ALLOC_BLOCK_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2490 |
N_("Allocation block size for query parsing and execution"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2491 |
(char**) &global_system_variables.query_alloc_block_size, |
617
by Brian Aker
ulong fixes |
2492 |
(char**) &max_system_variables.query_alloc_block_size, 0, GET_UINT, |
1
by brian
clean slate |
2493 |
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, |
2494 |
{"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2495 |
N_("Persistent buffer for query parsing and execution"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2496 |
(char**) &global_system_variables.query_prealloc_size, |
617
by Brian Aker
ulong fixes |
2497 |
(char**) &max_system_variables.query_prealloc_size, 0, GET_UINT, |
1
by brian
clean slate |
2498 |
REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE, |
2499 |
ULONG_MAX, 0, 1024, 0}, |
|
2500 |
{"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2501 |
N_("Allocation block size for storing ranges during optimization"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2502 |
(char**) &global_system_variables.range_alloc_block_size, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2503 |
(char**) &max_system_variables.range_alloc_block_size, 0, GET_SIZE, |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
2504 |
REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, RANGE_ALLOC_BLOCK_SIZE, SIZE_MAX, |
1
by brian
clean slate |
2505 |
0, 1024, 0}, |
2506 |
{"read_buffer_size", OPT_RECORD_BUFFER, |
|
619
by Brian Aker
Removed ulong methods from vars. |
2507 |
N_("Each thread that does a sequential scan allocates a buffer of this " |
2508 |
"size for each table it scans. If you do many sequential scans, you may "
|
|
2509 |
"want to increase this value."), |
|
2510 |
(char**) &global_system_variables.read_buff_size, |
|
2511 |
(char**) &max_system_variables.read_buff_size,0, GET_UINT, REQUIRED_ARG, |
|
2512 |
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, INT32_MAX, MALLOC_OVERHEAD, IO_SIZE, |
|
2513 |
0}, |
|
1
by brian
clean slate |
2514 |
{"read_rnd_buffer_size", OPT_RECORD_RND_BUFFER, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2515 |
N_("When reading rows in sorted order after a sort, the rows are read " |
2516 |
"through this buffer to avoid a disk seeks. If not set, then it's set "
|
|
2517 |
"to the value of record_buffer."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2518 |
(char**) &global_system_variables.read_rnd_buff_size, |
2519 |
(char**) &max_system_variables.read_rnd_buff_size, 0, |
|
619
by Brian Aker
Removed ulong methods from vars. |
2520 |
GET_UINT, REQUIRED_ARG, 256*1024L, 64 /*IO_SIZE*2+MALLOC_OVERHEAD*/ , |
2521 |
UINT32_MAX, MALLOC_OVERHEAD, 1 /* Small lower limit to be able to test MRR */, 0}, |
|
868
by Brian Aker
Adding Multi-threaded Scheduler into the system. |
2522 |
{"scheduler", OPT_SCHEDULER, |
2523 |
N_("Select scheduler to be used (by default pool-of-threads)."), |
|
2524 |
(char**) &opt_scheduler, (char**) &opt_scheduler, 0, |
|
2525 |
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
|
1
by brian
clean slate |
2526 |
{"sort_buffer_size", OPT_SORT_BUFFER, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2527 |
N_("Each thread that needs to do a sort allocates a buffer of this size."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2528 |
(char**) &global_system_variables.sortbuff_size, |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2529 |
(char**) &max_system_variables.sortbuff_size, 0, GET_SIZE, REQUIRED_ARG, |
629.4.1
by Monty Taylor
First step in support size_t sys_var stuff. |
2530 |
MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, SIZE_MAX, |
1
by brian
clean slate |
2531 |
MALLOC_OVERHEAD, 1, 0}, |
2532 |
{"table_definition_cache", OPT_TABLE_DEF_CACHE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2533 |
N_("The number of cached table definitions."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2534 |
(char**) &table_def_size, (char**) &table_def_size, |
622.1.1
by Brian Aker
32bit fixes around vars |
2535 |
0, GET_ULL, REQUIRED_ARG, 128, 1, 512*1024L, 0, 1, 0}, |
1
by brian
clean slate |
2536 |
{"table_open_cache", OPT_TABLE_OPEN_CACHE, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2537 |
N_("The number of cached open tables."), |
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2538 |
(char**) &table_cache_size, (char**) &table_cache_size, 0, GET_UINT64, |
1
by brian
clean slate |
2539 |
REQUIRED_ARG, TABLE_OPEN_CACHE_DEFAULT, 1, 512*1024L, 0, 1, 0}, |
2540 |
{"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2541 |
N_("Timeout in seconds to wait for a table level lock before returning an " |
2542 |
"error. Used only if the connection has active cursors."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2543 |
(char**) &table_lock_wait_timeout, (char**) &table_lock_wait_timeout, |
622.1.1
by Brian Aker
32bit fixes around vars |
2544 |
0, GET_ULL, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0}, |
1
by brian
clean slate |
2545 |
{"thread_stack", OPT_THREAD_STACK, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2546 |
N_("The stack size for each thread."), |
2547 |
(char**) &my_thread_stack_size, |
|
896.4.16
by Stewart Smith
for getopt, replace GET_ULONG with GET_UINT32. |
2548 |
(char**) &my_thread_stack_size, 0, GET_SIZE, |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2549 |
REQUIRED_ARG,DEFAULT_THREAD_STACK, |
629.2.7
by Monty Taylor
Fixed a couple of memory buffer size issues. |
2550 |
UINT32_C(1024*128), SIZE_MAX, 0, 1024, 0}, |
1
by brian
clean slate |
2551 |
{"tmp_table_size", OPT_TMP_TABLE_SIZE, |
672.1.3
by Andrew Hutchings
Minor string fixes (mainly US English spelling and typos) |
2552 |
N_("If an internal in-memory temporary table exceeds this size, Drizzle will" |
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2553 |
" automatically convert it to an on-disk MyISAM table."), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2554 |
(char**) &global_system_variables.tmp_table_size, |
2555 |
(char**) &max_system_variables.tmp_table_size, 0, GET_ULL, |
|
1
by brian
clean slate |
2556 |
REQUIRED_ARG, 16*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0}, |
2557 |
{"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2558 |
N_("Allocation block size for transactions to be stored in binary log"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2559 |
(char**) &global_system_variables.trans_alloc_block_size, |
617
by Brian Aker
ulong fixes |
2560 |
(char**) &max_system_variables.trans_alloc_block_size, 0, GET_UINT, |
1
by brian
clean slate |
2561 |
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, |
2562 |
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2563 |
N_("Persistent buffer for transactions to be stored in binary log"), |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2564 |
(char**) &global_system_variables.trans_prealloc_size, |
617
by Brian Aker
ulong fixes |
2565 |
(char**) &max_system_variables.trans_prealloc_size, 0, GET_UINT, |
1
by brian
clean slate |
2566 |
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ULONG_MAX, 0, 1024, 0}, |
2567 |
{"wait_timeout", OPT_WAIT_TIMEOUT, |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
2568 |
N_("The number of seconds the server waits for activity on a connection " |
2569 |
"before closing it."), |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
2570 |
(char**) &global_system_variables.net_wait_timeout, |
617
by Brian Aker
ulong fixes |
2571 |
(char**) &max_system_variables.net_wait_timeout, 0, GET_UINT, |
287.3.32
by Monty Taylor
Removed another useless define. |
2572 |
REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, |
1
by brian
clean slate |
2573 |
0, 1, 0}, |
2574 |
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} |
|
2575 |
};
|
|
2576 |
||
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
2577 |
static int show_net_compression(Session *session, |
77.1.45
by Monty Taylor
Warning fixes. |
2578 |
SHOW_VAR *var, |
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
2579 |
char *) |
1
by brian
clean slate |
2580 |
{
|
2581 |
var->type= SHOW_MY_BOOL; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
2582 |
var->value= (char *)&session->net.compress; |
1
by brian
clean slate |
2583 |
return 0; |
2584 |
}
|
|
2585 |
||
77.1.45
by Monty Taylor
Warning fixes. |
2586 |
static st_show_var_func_container |
2587 |
show_net_compression_cont= { &show_net_compression }; |
|
2588 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
2589 |
static int show_starttime(Session *session, SHOW_VAR *var, char *buff) |
1
by brian
clean slate |
2590 |
{
|
2591 |
var->type= SHOW_LONG; |
|
2592 |
var->value= buff; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
2593 |
*((long *)buff)= (long) (session->query_start() - server_start_time); |
1
by brian
clean slate |
2594 |
return 0; |
2595 |
}
|
|
2596 |
||
77.1.45
by Monty Taylor
Warning fixes. |
2597 |
static st_show_var_func_container |
2598 |
show_starttime_cont= { &show_starttime }; |
|
2599 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
2600 |
static int show_flushstatustime(Session *session, SHOW_VAR *var, char *buff) |
1
by brian
clean slate |
2601 |
{
|
2602 |
var->type= SHOW_LONG; |
|
2603 |
var->value= buff; |
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
2604 |
*((long *)buff)= (long) (session->query_start() - flush_status_time); |
1
by brian
clean slate |
2605 |
return 0; |
2606 |
}
|
|
2607 |
||
77.1.45
by Monty Taylor
Warning fixes. |
2608 |
static st_show_var_func_container |
2609 |
show_flushstatustime_cont= { &show_flushstatustime }; |
|
2610 |
||
779.1.29
by Monty Taylor
Merged from trunk. |
2611 |
static int show_open_tables(Session *, SHOW_VAR *var, char *buff) |
1
by brian
clean slate |
2612 |
{
|
2613 |
var->type= SHOW_LONG; |
|
2614 |
var->value= buff; |
|
2615 |
*((long *)buff)= (long)cached_open_tables(); |
|
2616 |
return 0; |
|
2617 |
}
|
|
2618 |
||
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
2619 |
static int show_table_definitions(Session *, |
77.1.45
by Monty Taylor
Warning fixes. |
2620 |
SHOW_VAR *var, char *buff) |
1
by brian
clean slate |
2621 |
{
|
2622 |
var->type= SHOW_LONG; |
|
2623 |
var->value= buff; |
|
2624 |
*((long *)buff)= (long)cached_table_definitions(); |
|
2625 |
return 0; |
|
2626 |
}
|
|
2627 |
||
77.1.45
by Monty Taylor
Warning fixes. |
2628 |
static st_show_var_func_container |
2629 |
show_open_tables_cont= { &show_open_tables }; |
|
2630 |
static st_show_var_func_container |
|
2631 |
show_table_definitions_cont= { &show_table_definitions }; |
|
2632 |
||
1
by brian
clean slate |
2633 |
/*
|
2634 |
Variables shown by SHOW STATUS in alphabetical order
|
|
2635 |
*/
|
|
2636 |
||
2637 |
SHOW_VAR status_vars[]= { |
|
625
by Brian Aker
ulong/64 bit straighten out. |
2638 |
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONGLONG}, |
2639 |
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONGLONG}, |
|
1
by brian
clean slate |
2640 |
{"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS}, |
2641 |
{"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS}, |
|
2642 |
{"Com", (char*) com_status_vars, SHOW_ARRAY}, |
|
77.1.45
by Monty Taylor
Warning fixes. |
2643 |
{"Compression", (char*) &show_net_compression_cont, SHOW_FUNC}, |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2644 |
{"Connections", (char*) &thread_id, SHOW_INT_NOFLUSH}, |
1
by brian
clean slate |
2645 |
{"Created_tmp_disk_tables", (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS}, |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2646 |
{"Created_tmp_files", (char*) &my_tmp_file_created,SHOW_INT}, |
1
by brian
clean slate |
2647 |
{"Created_tmp_tables", (char*) offsetof(STATUS_VAR, created_tmp_tables), SHOW_LONG_STATUS}, |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2648 |
{"Flush_commands", (char*) &refresh_version, SHOW_INT_NOFLUSH}, |
1
by brian
clean slate |
2649 |
{"Handler_commit", (char*) offsetof(STATUS_VAR, ha_commit_count), SHOW_LONG_STATUS}, |
2650 |
{"Handler_delete", (char*) offsetof(STATUS_VAR, ha_delete_count), SHOW_LONG_STATUS}, |
|
2651 |
{"Handler_prepare", (char*) offsetof(STATUS_VAR, ha_prepare_count), SHOW_LONG_STATUS}, |
|
2652 |
{"Handler_read_first", (char*) offsetof(STATUS_VAR, ha_read_first_count), SHOW_LONG_STATUS}, |
|
2653 |
{"Handler_read_key", (char*) offsetof(STATUS_VAR, ha_read_key_count), SHOW_LONG_STATUS}, |
|
2654 |
{"Handler_read_next", (char*) offsetof(STATUS_VAR, ha_read_next_count), SHOW_LONG_STATUS}, |
|
2655 |
{"Handler_read_prev", (char*) offsetof(STATUS_VAR, ha_read_prev_count), SHOW_LONG_STATUS}, |
|
2656 |
{"Handler_read_rnd", (char*) offsetof(STATUS_VAR, ha_read_rnd_count), SHOW_LONG_STATUS}, |
|
2657 |
{"Handler_read_rnd_next", (char*) offsetof(STATUS_VAR, ha_read_rnd_next_count), SHOW_LONG_STATUS}, |
|
2658 |
{"Handler_rollback", (char*) offsetof(STATUS_VAR, ha_rollback_count), SHOW_LONG_STATUS}, |
|
2659 |
{"Handler_savepoint", (char*) offsetof(STATUS_VAR, ha_savepoint_count), SHOW_LONG_STATUS}, |
|
2660 |
{"Handler_savepoint_rollback",(char*) offsetof(STATUS_VAR, ha_savepoint_rollback_count), SHOW_LONG_STATUS}, |
|
2661 |
{"Handler_update", (char*) offsetof(STATUS_VAR, ha_update_count), SHOW_LONG_STATUS}, |
|
2662 |
{"Handler_write", (char*) offsetof(STATUS_VAR, ha_write_count), SHOW_LONG_STATUS}, |
|
2663 |
{"Key_blocks_not_flushed", (char*) offsetof(KEY_CACHE, global_blocks_changed), SHOW_KEY_CACHE_LONG}, |
|
2664 |
{"Key_blocks_unused", (char*) offsetof(KEY_CACHE, blocks_unused), SHOW_KEY_CACHE_LONG}, |
|
2665 |
{"Key_blocks_used", (char*) offsetof(KEY_CACHE, blocks_used), SHOW_KEY_CACHE_LONG}, |
|
2666 |
{"Key_read_requests", (char*) offsetof(KEY_CACHE, global_cache_r_requests), SHOW_KEY_CACHE_LONGLONG}, |
|
2667 |
{"Key_reads", (char*) offsetof(KEY_CACHE, global_cache_read), SHOW_KEY_CACHE_LONGLONG}, |
|
2668 |
{"Key_write_requests", (char*) offsetof(KEY_CACHE, global_cache_w_requests), SHOW_KEY_CACHE_LONGLONG}, |
|
2669 |
{"Key_writes", (char*) offsetof(KEY_CACHE, global_cache_write), SHOW_KEY_CACHE_LONGLONG}, |
|
2670 |
{"Last_query_cost", (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS}, |
|
625
by Brian Aker
ulong/64 bit straighten out. |
2671 |
{"Max_used_connections", (char*) &max_used_connections, SHOW_INT}, |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2672 |
{"Open_files", (char*) &my_file_opened, SHOW_INT_NOFLUSH}, |
2673 |
{"Open_streams", (char*) &my_stream_opened, SHOW_INT_NOFLUSH}, |
|
77.1.45
by Monty Taylor
Warning fixes. |
2674 |
{"Open_table_definitions", (char*) &show_table_definitions_cont, SHOW_FUNC}, |
2675 |
{"Open_tables", (char*) &show_open_tables_cont, SHOW_FUNC}, |
|
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2676 |
{"Opened_files", (char*) &my_file_total_opened, SHOW_INT_NOFLUSH}, |
1
by brian
clean slate |
2677 |
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS}, |
2678 |
{"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS}, |
|
2679 |
{"Questions", (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS}, |
|
2680 |
{"Select_full_join", (char*) offsetof(STATUS_VAR, select_full_join_count), SHOW_LONG_STATUS}, |
|
2681 |
{"Select_full_range_join", (char*) offsetof(STATUS_VAR, select_full_range_join_count), SHOW_LONG_STATUS}, |
|
2682 |
{"Select_range", (char*) offsetof(STATUS_VAR, select_range_count), SHOW_LONG_STATUS}, |
|
2683 |
{"Select_range_check", (char*) offsetof(STATUS_VAR, select_range_check_count), SHOW_LONG_STATUS}, |
|
2684 |
{"Select_scan", (char*) offsetof(STATUS_VAR, select_scan_count), SHOW_LONG_STATUS}, |
|
625
by Brian Aker
ulong/64 bit straighten out. |
2685 |
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONGLONG}, |
1
by brian
clean slate |
2686 |
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS}, |
2687 |
{"Sort_merge_passes", (char*) offsetof(STATUS_VAR, filesort_merge_passes), SHOW_LONG_STATUS}, |
|
2688 |
{"Sort_range", (char*) offsetof(STATUS_VAR, filesort_range_count), SHOW_LONG_STATUS}, |
|
2689 |
{"Sort_rows", (char*) offsetof(STATUS_VAR, filesort_rows), SHOW_LONG_STATUS}, |
|
2690 |
{"Sort_scan", (char*) offsetof(STATUS_VAR, filesort_scan_count), SHOW_LONG_STATUS}, |
|
625
by Brian Aker
ulong/64 bit straighten out. |
2691 |
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_INT}, |
2692 |
{"Table_locks_waited", (char*) &locks_waited, SHOW_INT}, |
|
1
by brian
clean slate |
2693 |
{"Threads_connected", (char*) &connection_count, SHOW_INT}, |
937.2.4
by Stewart Smith
yet more variable alignment/type fixes. |
2694 |
{"Threads_created", (char*) &thread_created, SHOW_INT_NOFLUSH}, |
1
by brian
clean slate |
2695 |
{"Threads_running", (char*) &thread_running, SHOW_INT}, |
77.1.45
by Monty Taylor
Warning fixes. |
2696 |
{"Uptime", (char*) &show_starttime_cont, SHOW_FUNC}, |
2697 |
{"Uptime_since_flush_status",(char*) &show_flushstatustime_cont, SHOW_FUNC}, |
|
625
by Brian Aker
ulong/64 bit straighten out. |
2698 |
{NULL, NULL, SHOW_LONGLONG} |
1
by brian
clean slate |
2699 |
};
|
2700 |
||
2701 |
static void print_version(void) |
|
2702 |
{
|
|
2703 |
set_server_version(); |
|
2704 |
/*
|
|
2705 |
Note: the instance manager keys off the string 'Ver' so it can find the
|
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2706 |
version from the output of 'drizzled --version', so don't change it!
|
1
by brian
clean slate |
2707 |
*/
|
2708 |
printf("%s Ver %s for %s on %s (%s)\n",my_progname, |
|
546
by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed) |
2709 |
server_version,SYSTEM_TYPE,MACHINE_TYPE, COMPILATION_COMMENT); |
1
by brian
clean slate |
2710 |
}
|
2711 |
||
2712 |
static void usage(void) |
|
2713 |
{
|
|
862
by Brian Aker
Remove charset directory code. |
2714 |
if (!(default_charset_info= get_charset_by_csname(default_character_set_name, MY_CS_PRIMARY))) |
1
by brian
clean slate |
2715 |
exit(1); |
2716 |
if (!default_collation_name) |
|
2717 |
default_collation_name= (char*) default_charset_info->name; |
|
2718 |
print_version(); |
|
656.1.27
by Monty Taylor
Fixed the mysqld in the drizzle.cnf thing. |
2719 |
puts(_("Copyright (C) 2008 Sun Microsystems\n" |
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2720 |
"This software comes with ABSOLUTELY NO WARRANTY. "
|
2721 |
"This is free software,\n" |
|
2722 |
"and you are welcome to modify and redistribute it under the GPL "
|
|
2723 |
"license\n\n" |
|
2724 |
"Starts the Drizzle database server\n")); |
|
1
by brian
clean slate |
2725 |
|
312.1.12
by Monty Taylor
Fixed a syntax oops. |
2726 |
printf(_("Usage: %s [OPTIONS]\n"), my_progname); |
1
by brian
clean slate |
2727 |
{
|
259
by Brian Aker
First pass on PAM auth |
2728 |
#ifdef FOO
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
2729 |
print_defaults(DRIZZLE_CONFIG_NAME,load_default_groups); |
1
by brian
clean slate |
2730 |
puts(""); |
2731 |
set_ports(); |
|
259
by Brian Aker
First pass on PAM auth |
2732 |
#endif
|
1
by brian
clean slate |
2733 |
|
2734 |
/* Print out all the options including plugin supplied options */
|
|
2735 |
my_print_help_inc_plugins(my_long_options, sizeof(my_long_options)/sizeof(my_option)); |
|
2736 |
||
312.1.11
by Monty Taylor
Added some strings from drizzled.cc. |
2737 |
puts(_("\nTo see what values a running Drizzle server is using, type\n" |
2738 |
"'drizzleadmin variables' instead of 'drizzled --help'.")); |
|
1
by brian
clean slate |
2739 |
}
|
2740 |
}
|
|
2741 |
||
2742 |
||
2743 |
/**
|
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
2744 |
Initialize all Drizzle global variables to default values.
|
1
by brian
clean slate |
2745 |
|
2746 |
We don't need to set numeric variables refered to in my_long_options
|
|
2747 |
as these are initialized by my_getopt.
|
|
2748 |
||
2749 |
@note
|
|
2750 |
The reason to set a lot of global variables to zero is to allow one to
|
|
2751 |
restart the embedded server with a clean environment
|
|
2752 |
It's also needed on some exotic platforms where global variables are
|
|
2753 |
not set to 0 when a program starts.
|
|
2754 |
||
2755 |
We don't need to set numeric variables refered to in my_long_options
|
|
2756 |
as these are initialized by my_getopt.
|
|
2757 |
*/
|
|
2758 |
||
574.2.1
by ysano
Rename mysql to drizzle. |
2759 |
static void drizzle_init_variables(void) |
1
by brian
clean slate |
2760 |
{
|
2761 |
/* Things reset to zero */
|
|
722.4.1
by Mark Atwood
integrate errmsg plugin into sql_print_* functions |
2762 |
drizzle_home[0]= pidfile_name[0]= 0; |
1
by brian
clean slate |
2763 |
opt_bin_log= 0; |
228
by Brian Aker
First pass on socket cleanup. |
2764 |
opt_skip_show_db=0; |
798.2.32
by Brian Aker
Last removal of variables. |
2765 |
opt_logname= 0; |
1
by brian
clean slate |
2766 |
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name ! |
2767 |
opt_secure_file_priv= 0; |
|
900
by Brian Aker
Creating signal handler plugin. |
2768 |
segfaulted= 0; |
1
by brian
clean slate |
2769 |
cleanup_done= 0; |
2770 |
defaults_argc= 0; |
|
2771 |
defaults_argv= 0; |
|
2772 |
server_id_supplied= 0; |
|
2773 |
test_flags= select_errors= dropping_tables= ha_open_options=0; |
|
929.1.1
by Brian Aker
Push thread count out to the scheduler. |
2774 |
thread_running= wake_thread=0; |
1
by brian
clean slate |
2775 |
slave_open_temp_tables= 0; |
2776 |
opt_endinfo= using_udf_functions= 0; |
|
604
by Brian Aker
Remove lock condition needed (we do row based replication, so... lock is |
2777 |
opt_using_transactions= false; |
909
by Brian Aker
Remove the need for unireg init |
2778 |
abort_loop= select_thread_in_use= false; |
1
by brian
clean slate |
2779 |
ready_to_exit= shutdown_in_progress= 0; |
2780 |
aborted_threads= aborted_connects= 0; |
|
779.3.23
by Monty Taylor
More fixy-fixes. |
2781 |
max_used_connections= 0; |
2782 |
slow_launch_threads= 0; |
|
574.2.1
by ysano
Rename mysql to drizzle. |
2783 |
drizzled_user= drizzled_chroot= opt_init_file= opt_bin_logname = 0; |
680
by Brian Aker
Remove locks around temp tables for searching tmp directory path. |
2784 |
my_bind_addr_str= NULL; |
212.6.6
by Mats Kindahl
Removing redundant use of casts in drizzled/ for memcmp(), memcpy(), memset(), and memmove(). |
2785 |
memset(&global_status_var, 0, sizeof(global_status_var)); |
1
by brian
clean slate |
2786 |
key_map_full.set_all(); |
2787 |
||
2788 |
/* Character sets */
|
|
2789 |
system_charset_info= &my_charset_utf8_general_ci; |
|
2790 |
files_charset_info= &my_charset_utf8_general_ci; |
|
2791 |
table_alias_charset= &my_charset_bin; |
|
2792 |
character_set_filesystem= &my_charset_bin; |
|
2793 |
||
2794 |
/* Things with default values that are not zero */
|
|
895
by Brian Aker
Completion (?) of uint conversion. |
2795 |
delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_ON; |
575.4.1
by ysano
Rename mysql to drizzle. |
2796 |
drizzle_home_ptr= drizzle_home; |
1
by brian
clean slate |
2797 |
pidfile_name_ptr= pidfile_name; |
2798 |
language_ptr= language; |
|
575.4.1
by ysano
Rename mysql to drizzle. |
2799 |
drizzle_data_home= drizzle_real_data_home; |
818
by Brian Aker
Found a few bits to be deleted (around binlog). |
2800 |
session_startup_options= (OPTION_AUTO_IS_NULL | OPTION_SQL_NOTES); |
1
by brian
clean slate |
2801 |
refresh_version= 1L; /* Increments on each reload */ |
561.1.3
by Monty Taylor
Split some more things out of common_includes.h. |
2802 |
thread_id= 1; |
641.4.1
by Toru Maesaka
First pass of replacing MySQL's my_stpcpy() with appropriate libc calls |
2803 |
strcpy(server_version, VERSION); |
1
by brian
clean slate |
2804 |
myisam_recover_options_str= "OFF"; |
2805 |
myisam_stats_method_str= "nulls_unequal"; |
|
934.3.10
by Monty Taylor
Revert std::vector changes. dammit. |
2806 |
session_list.empty(); |
1
by brian
clean slate |
2807 |
key_caches.empty(); |
2808 |
if (!(dflt_key_cache= get_or_create_key_cache(default_key_cache_base.str, |
|
2809 |
default_key_cache_base.length))) |
|
2810 |
exit(1); |
|
2811 |
/* set key_cache_hash.default_value = dflt_key_cache */
|
|
2812 |
multi_keycache_init(); |
|
2813 |
||
2814 |
/* Set directory paths */
|
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2815 |
strncpy(language, LANGUAGE, sizeof(language)-1); |
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
2816 |
strncpy(drizzle_real_data_home, get_relative_path(LOCALSTATEDIR), |
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2817 |
sizeof(drizzle_real_data_home)-1); |
575.4.3
by ysano
Rename mysql to drizzle. |
2818 |
drizzle_data_home_buff[0]=FN_CURLIB; // all paths are relative from here |
2819 |
drizzle_data_home_buff[1]=0; |
|
575.4.1
by ysano
Rename mysql to drizzle. |
2820 |
drizzle_data_home_len= 2; |
1
by brian
clean slate |
2821 |
|
2822 |
/* Variables in libraries */
|
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
2823 |
default_character_set_name= (char*) DRIZZLE_DEFAULT_CHARSET_NAME; |
1
by brian
clean slate |
2824 |
default_collation_name= compiled_default_collation_name; |
2825 |
character_set_filesystem_name= (char*) "binary"; |
|
2826 |
lc_time_names_name= (char*) "en_US"; |
|
2827 |
/* Set default values for some option variables */
|
|
201
by Brian Aker
Convert default engine to Innodb |
2828 |
default_storage_engine_str= (char*) "innodb"; |
1
by brian
clean slate |
2829 |
global_system_variables.table_plugin= NULL; |
2830 |
global_system_variables.tx_isolation= ISO_REPEATABLE_READ; |
|
151
by Brian Aker
Ulonglong to uint64_t |
2831 |
global_system_variables.select_limit= (uint64_t) HA_POS_ERROR; |
2832 |
max_system_variables.select_limit= (uint64_t) HA_POS_ERROR; |
|
2833 |
global_system_variables.max_join_size= (uint64_t) HA_POS_ERROR; |
|
2834 |
max_system_variables.max_join_size= (uint64_t) HA_POS_ERROR; |
|
1
by brian
clean slate |
2835 |
global_system_variables.old_alter_table= 0; |
2836 |
/*
|
|
2837 |
Default behavior for 4.1 and 5.0 is to treat NULL values as unequal
|
|
2838 |
when collecting index statistics for MyISAM tables.
|
|
2839 |
*/
|
|
2840 |
global_system_variables.myisam_stats_method= MI_STATS_METHOD_NULLS_NOT_EQUAL; |
|
2841 |
||
2842 |
/* Variables that depends on compile options */
|
|
2843 |
#ifdef HAVE_BROKEN_REALPATH
|
|
2844 |
have_symlink=SHOW_OPTION_NO; |
|
2845 |
#else
|
|
2846 |
have_symlink=SHOW_OPTION_YES; |
|
2847 |
#endif
|
|
2848 |
||
2849 |
const char *tmpenv; |
|
2850 |
if (!(tmpenv = getenv("MY_BASEDIR_VERSION"))) |
|
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
2851 |
tmpenv = PREFIX; |
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2852 |
(void) strncpy(drizzle_home, tmpenv, sizeof(drizzle_home)-1); |
942.2.5
by Brian Aker
Fix, again, the thread lock issues for unlink_session |
2853 |
|
2854 |
connection_count= 0; |
|
1
by brian
clean slate |
2855 |
}
|
2856 |
||
2857 |
||
143
by Brian Aker
Bool cleanup. |
2858 |
bool
|
779.1.27
by Monty Taylor
Got rid of __attribute__((unused)) and the like from the .cc files. |
2859 |
drizzled_get_one_option(int optid, const struct my_option *opt, |
2860 |
char *argument) |
|
1
by brian
clean slate |
2861 |
{
|
2862 |
switch(optid) { |
|
2863 |
case '#': |
|
2864 |
opt_endinfo=1; /* unireg: memory allocation */ |
|
2865 |
break; |
|
2866 |
case 'a': |
|
2867 |
global_system_variables.tx_isolation= ISO_SERIALIZABLE; |
|
2868 |
break; |
|
2869 |
case 'b': |
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2870 |
strncpy(drizzle_home,argument,sizeof(drizzle_home)-1); |
1
by brian
clean slate |
2871 |
break; |
2872 |
case 'C': |
|
2873 |
if (default_collation_name == compiled_default_collation_name) |
|
2874 |
default_collation_name= 0; |
|
2875 |
break; |
|
2876 |
case 'h': |
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2877 |
strncpy(drizzle_real_data_home,argument, sizeof(drizzle_real_data_home)-1); |
1
by brian
clean slate |
2878 |
/* Correct pointer set by my_getopt (for embedded library) */
|
575.4.1
by ysano
Rename mysql to drizzle. |
2879 |
drizzle_data_home= drizzle_real_data_home; |
2880 |
drizzle_data_home_len= strlen(drizzle_data_home); |
|
1
by brian
clean slate |
2881 |
break; |
2882 |
case 'u': |
|
574.2.1
by ysano
Rename mysql to drizzle. |
2883 |
if (!drizzled_user || !strcmp(drizzled_user, argument)) |
2884 |
drizzled_user= argument; |
|
1
by brian
clean slate |
2885 |
else
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
2886 |
errmsg_printf(ERRMSG_LVL_WARN, _("Ignoring user change to '%s' because the user was " |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
2887 |
"set to '%s' earlier on the command line\n"), |
574.2.1
by ysano
Rename mysql to drizzle. |
2888 |
argument, drizzled_user); |
1
by brian
clean slate |
2889 |
break; |
2890 |
case 'L': |
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2891 |
strncpy(language, argument, sizeof(language)-1); |
1
by brian
clean slate |
2892 |
break; |
2893 |
case 'V': |
|
2894 |
print_version(); |
|
2895 |
exit(0); |
|
2896 |
case 'W': |
|
2897 |
if (!argument) |
|
2898 |
global_system_variables.log_warnings++; |
|
2899 |
else if (argument == disabled_my_option) |
|
2900 |
global_system_variables.log_warnings= 0L; |
|
2901 |
else
|
|
2902 |
global_system_variables.log_warnings= atoi(argument); |
|
2903 |
break; |
|
2904 |
case 'T': |
|
895
by Brian Aker
Completion (?) of uint conversion. |
2905 |
test_flags= argument ? (uint32_t) atoi(argument) : 0; |
1
by brian
clean slate |
2906 |
opt_endinfo=1; |
2907 |
break; |
|
2908 |
case (int) OPT_BIN_LOG: |
|
2909 |
opt_bin_log= test(argument != disabled_my_option); |
|
2910 |
break; |
|
2911 |
case (int) OPT_WANT_CORE: |
|
2912 |
test_flags |= TEST_CORE_ON_SIGNAL; |
|
2913 |
break; |
|
2914 |
case (int) OPT_SKIP_STACK_TRACE: |
|
2915 |
test_flags|=TEST_NO_STACKTRACE; |
|
2916 |
break; |
|
2917 |
case (int) OPT_SKIP_SYMLINKS: |
|
2918 |
my_use_symdir=0; |
|
2919 |
break; |
|
2920 |
case (int) OPT_BIND_ADDRESS: |
|
2921 |
{
|
|
236.1.40
by Monty Taylor
A few meaningless changes. |
2922 |
struct addrinfo *res_lst, hints; |
1
by brian
clean slate |
2923 |
|
212.6.1
by Mats Kindahl
Replacing all bzero() calls with memset() calls and removing the bzero.c file. |
2924 |
memset(&hints, 0, sizeof(struct addrinfo)); |
1
by brian
clean slate |
2925 |
hints.ai_socktype= SOCK_STREAM; |
2926 |
hints.ai_protocol= IPPROTO_TCP; |
|
2927 |
||
236.1.40
by Monty Taylor
A few meaningless changes. |
2928 |
if (getaddrinfo(argument, NULL, &hints, &res_lst) != 0) |
1
by brian
clean slate |
2929 |
{
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
2930 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Can't start server: cannot resolve hostname!")); |
1
by brian
clean slate |
2931 |
exit(1); |
2932 |
}
|
|
2933 |
||
2934 |
if (res_lst->ai_next) |
|
2935 |
{
|
|
755.2.1
by Mark Atwood
replace sql_print_error etc with errmsg_print |
2936 |
errmsg_printf(ERRMSG_LVL_ERROR, _("Can't start server: bind-address refers to " |
312.1.10
by Monty Taylor
Added some strings from drizzled.cc. |
2937 |
"multiple interfaces!")); |
1
by brian
clean slate |
2938 |
exit(1); |
2939 |
}
|
|
2940 |
freeaddrinfo(res_lst); |
|
2941 |
}
|
|
2942 |
break; |
|
2943 |
case (int) OPT_PID_FILE: |
|
629.5.4
by Toru Maesaka
Fourth pass of replacing MySQL's strmake() with libc calls |
2944 |
strncpy(pidfile_name, argument, sizeof(pidfile_name)-1); |
1
by brian
clean slate |
2945 |
break; |
2946 |
case OPT_SERVER_ID: |
|
2947 |
server_id_supplied = 1; |
|
2948 |
break; |
|
2949 |
case OPT_DELAY_KEY_WRITE_ALL: |
|
2950 |
if (argument != disabled_my_option) |
|
2951 |
argument= (char*) "ALL"; |
|
2952 |
/* Fall through */
|
|
2953 |
case OPT_DELAY_KEY_WRITE: |
|
2954 |
if (argument == disabled_my_option) |
|
895
by Brian Aker
Completion (?) of uint conversion. |
2955 |
delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_NONE; |
1
by brian
clean slate |
2956 |
else if (! argument) |
895
by Brian Aker
Completion (?) of uint conversion. |
2957 |
delay_key_write_options= (uint32_t) DELAY_KEY_WRITE_ON; |
1
by brian
clean slate |
2958 |
else
|
2959 |
{
|
|
2960 |
int type; |
|
2961 |
type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name); |
|
895
by Brian Aker
Completion (?) of uint conversion. |
2962 |
delay_key_write_options= (uint32_t) type-1; |
1
by brian
clean slate |
2963 |
}
|
2964 |
break; |
|
2965 |
case OPT_TX_ISOLATION: |
|
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
2966 |
{
|
2967 |
int type; |
|
2968 |
type= find_type_or_exit(argument, &tx_isolation_typelib, opt->name); |
|
2969 |
global_system_variables.tx_isolation= (type-1); |
|
2970 |
break; |
|
2971 |
}
|
|
1
by brian
clean slate |
2972 |
case OPT_MYISAM_RECOVER: |
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
2973 |
{
|
2974 |
if (!argument) |
|
2975 |
{
|
|
2976 |
myisam_recover_options= HA_RECOVER_DEFAULT; |
|
2977 |
myisam_recover_options_str= myisam_recover_typelib.type_names[0]; |
|
2978 |
}
|
|
2979 |
else if (!argument[0]) |
|
2980 |
{
|
|
2981 |
myisam_recover_options= HA_RECOVER_NONE; |
|
2982 |
myisam_recover_options_str= "OFF"; |
|
2983 |
}
|
|
2984 |
else
|
|
2985 |
{
|
|
2986 |
myisam_recover_options_str=argument; |
|
2987 |
myisam_recover_options= |
|
2988 |
find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name); |
|
2989 |
}
|
|
2990 |
ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; |
|
2991 |
break; |
|
2992 |
}
|
|
1
by brian
clean slate |
2993 |
case OPT_TC_HEURISTIC_RECOVER: |
2994 |
tc_heuristic_recover= find_type_or_exit(argument, |
|
2995 |
&tc_heuristic_recover_typelib, |
|
2996 |
opt->name); |
|
2997 |
break; |
|
2998 |
case OPT_MYISAM_STATS_METHOD: |
|
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
2999 |
{
|
366
by Patrick Galbraith
Ulong conversion |
3000 |
uint32_t method_conv; |
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
3001 |
int method; |
1
by brian
clean slate |
3002 |
|
224.2.2
by Brian Aker
Second pass cleanup around filesystem type. |
3003 |
myisam_stats_method_str= argument; |
3004 |
method= find_type_or_exit(argument, &myisam_stats_method_typelib, |
|
3005 |
opt->name); |
|
3006 |
switch (method-1) { |
|
3007 |
case 2: |
|
3008 |
method_conv= MI_STATS_METHOD_IGNORE_NULLS; |
|
3009 |
break; |
|
3010 |
case 1: |
|
3011 |
method_conv= MI_STATS_METHOD_NULLS_EQUAL; |
|
3012 |
break; |
|
3013 |
case 0: |
|
3014 |
default: |
|
3015 |
method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL; |
|
3016 |
break; |
|
3017 |
}
|
|
3018 |
global_system_variables.myisam_stats_method= method_conv; |
|
1
by brian
clean slate |
3019 |
break; |
3020 |
}
|
|
3021 |
}
|
|
3022 |
return 0; |
|
3023 |
}
|
|
3024 |
||
3025 |
||
3026 |
/** Handle arguments for multiple key caches. */
|
|
3027 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
3028 |
extern "C" char **drizzle_getopt_value(const char *keyname, uint32_t key_length, |
590.2.19
by Super-User
Yay! Compiles on Solaris. |
3029 |
const struct my_option *option); |
1
by brian
clean slate |
3030 |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3031 |
char** |
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
3032 |
drizzle_getopt_value(const char *keyname, uint32_t key_length, |
590.2.19
by Super-User
Yay! Compiles on Solaris. |
3033 |
const struct my_option *option) |
1
by brian
clean slate |
3034 |
{
|
3035 |
switch (option->id) { |
|
3036 |
case OPT_KEY_BUFFER_SIZE: |
|
3037 |
case OPT_KEY_CACHE_BLOCK_SIZE: |
|
3038 |
case OPT_KEY_CACHE_DIVISION_LIMIT: |
|
3039 |
case OPT_KEY_CACHE_AGE_THRESHOLD: |
|
3040 |
{
|
|
3041 |
KEY_CACHE *key_cache; |
|
3042 |
if (!(key_cache= get_or_create_key_cache(keyname, key_length))) |
|
3043 |
exit(1); |
|
3044 |
switch (option->id) { |
|
3045 |
case OPT_KEY_BUFFER_SIZE: |
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3046 |
return (char**) &key_cache->param_buff_size; |
1
by brian
clean slate |
3047 |
case OPT_KEY_CACHE_BLOCK_SIZE: |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3048 |
return (char**) &key_cache->param_block_size; |
1
by brian
clean slate |
3049 |
case OPT_KEY_CACHE_DIVISION_LIMIT: |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3050 |
return (char**) &key_cache->param_division_limit; |
1
by brian
clean slate |
3051 |
case OPT_KEY_CACHE_AGE_THRESHOLD: |
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3052 |
return (char**) &key_cache->param_age_threshold; |
1
by brian
clean slate |
3053 |
}
|
3054 |
}
|
|
3055 |
}
|
|
77.1.77
by Monty Taylor
A crapton more warning cleanups (I turned on more warnings) |
3056 |
return (char **)option->value; |
1
by brian
clean slate |
3057 |
}
|
3058 |
||
3059 |
||
3060 |
extern "C" void option_error_reporter(enum loglevel level, const char *format, ...); |
|
3061 |
||
3062 |
void option_error_reporter(enum loglevel level, const char *format, ...) |
|
3063 |
{
|
|
3064 |
va_list args; |
|
3065 |
va_start(args, format); |
|
3066 |
||
3067 |
/* Don't print warnings for --loose options during bootstrap */
|
|
228
by Brian Aker
First pass on socket cleanup. |
3068 |
if (level == ERROR_LEVEL || global_system_variables.log_warnings) |
1
by brian
clean slate |
3069 |
{
|
612.1.1
by Mark Atwood
remove some errmsg dead code, use more of the errmsg plugin |
3070 |
errmsg_vprintf (current_session, ERROR_LEVEL, format, args); |
1
by brian
clean slate |
3071 |
}
|
3072 |
va_end(args); |
|
3073 |
}
|
|
3074 |
||
3075 |
||
3076 |
/**
|
|
3077 |
@todo
|
|
3078 |
- FIXME add EXIT_TOO_MANY_ARGUMENTS to "mysys_err.h" and return that code?
|
|
3079 |
*/
|
|
3080 |
static void get_options(int *argc,char **argv) |
|
3081 |
{
|
|
3082 |
int ho_error; |
|
3083 |
||
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
3084 |
my_getopt_register_get_addr(drizzle_getopt_value); |
1
by brian
clean slate |
3085 |
my_getopt_error_reporter= option_error_reporter; |
3086 |
||
3087 |
/* Skip unknown options so that they may be processed later by plugins */
|
|
163
by Brian Aker
Merge Monty's code. |
3088 |
my_getopt_skip_unknown= true; |
1
by brian
clean slate |
3089 |
|
3090 |
if ((ho_error= handle_options(argc, &argv, my_long_options, |
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
3091 |
drizzled_get_one_option))) |
1
by brian
clean slate |
3092 |
exit(ho_error); |
3093 |
(*argc)++; /* add back one for the progname handle_options removes */ |
|
3094 |
/* no need to do this for argv as we are discarding it. */
|
|
3095 |
||
3096 |
#if defined(HAVE_BROKEN_REALPATH)
|
|
3097 |
my_use_symdir=0; |
|
3098 |
my_disable_symlinks=1; |
|
3099 |
have_symlink=SHOW_OPTION_NO; |
|
3100 |
#else
|
|
3101 |
if (!my_use_symdir) |
|
3102 |
{
|
|
3103 |
my_disable_symlinks=1; |
|
3104 |
have_symlink=SHOW_OPTION_DISABLED; |
|
3105 |
}
|
|
3106 |
#endif
|
|
3107 |
if (opt_debugging) |
|
3108 |
{
|
|
3109 |
/* Allow break with SIGINT, no core or stack trace */
|
|
3110 |
test_flags|= TEST_SIGINT | TEST_NO_STACKTRACE; |
|
3111 |
test_flags&= ~TEST_CORE_ON_SIGNAL; |
|
3112 |
}
|
|
3113 |
/* Set global MyISAM variables from delay_key_write_options */
|
|
520.1.21
by Brian Aker
THD -> Session rename |
3114 |
fix_delay_key_write((Session*) 0, OPT_GLOBAL); |
1
by brian
clean slate |
3115 |
|
574.2.1
by ysano
Rename mysql to drizzle. |
3116 |
if (drizzled_chroot) |
3117 |
set_root(drizzled_chroot); |
|
1
by brian
clean slate |
3118 |
fix_paths(); |
3119 |
||
3120 |
/*
|
|
3121 |
Set some global variables from the global_system_variables
|
|
3122 |
In most cases the global variables will not be used
|
|
3123 |
*/
|
|
3124 |
my_default_record_cache_size=global_system_variables.read_buff_size; |
|
788
by Brian Aker
Move MyISAM bits to myisam plugin |
3125 |
myisam_max_temp_length= INT32_MAX; |
1
by brian
clean slate |
3126 |
}
|
3127 |
||
3128 |
/*
|
|
575.4.4
by Yoshinori Sano
Rename mysql to drizzle. |
3129 |
Create version name for running drizzled version
|
1
by brian
clean slate |
3130 |
We automaticly add suffixes -debug, -embedded and -log to the version
|
3131 |
name to make the version more descriptive.
|
|
319.1.1
by Grant Limberg
renamed all instances of MYSQL_ to DRIZZLE_ |
3132 |
(DRIZZLE_SERVER_SUFFIX is set by the compilation environment)
|
1
by brian
clean slate |
3133 |
*/
|
3134 |
||
390.1.1
by Monty Taylor
Removed mysqld_suffix. Pointless. |
3135 |
#ifdef DRIZZLE_SERVER_SUFFIX
|
3136 |
#define DRIZZLE_SERVER_SUFFIX_STR STRINGIFY_ARG(DRIZZLE_SERVER_SUFFIX)
|
|
3137 |
#else
|
|
546
by Monty Taylor
Cleaned up version.h. (And by cleaned, I mean removed) |
3138 |
#define DRIZZLE_SERVER_SUFFIX_STR ""
|
390.1.1
by Monty Taylor
Removed mysqld_suffix. Pointless. |
3139 |
#endif
|
3140 |
||
1
by brian
clean slate |
3141 |
static void set_server_version(void) |
3142 |
{
|
|
673.2.1
by Toru Maesaka
First pass of replacing MySQL's strxmov with libc alternatives |
3143 |
char *end= server_version; |
3144 |
end+= sprintf(server_version, "%s%s", VERSION, |
|
3145 |
DRIZZLE_SERVER_SUFFIX_STR); |
|
438.1.1
by Brian Aker
First pass of removing historical logging. |
3146 |
if (opt_bin_log) |
673.2.1
by Toru Maesaka
First pass of replacing MySQL's strxmov with libc alternatives |
3147 |
strcpy(end, "-log"); // This may slow down system |
1
by brian
clean slate |
3148 |
}
|
3149 |
||
3150 |
||
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
3151 |
static const char *get_relative_path(const char *path) |
1
by brian
clean slate |
3152 |
{
|
3153 |
if (test_if_hard_path(path) && |
|
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
3154 |
is_prefix(path,PREFIX) && |
3155 |
strcmp(PREFIX,FN_ROOTDIR)) |
|
1
by brian
clean slate |
3156 |
{
|
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
3157 |
if (strlen(PREFIX) < strlen(path)) |
3158 |
path+=(size_t) strlen(PREFIX); |
|
1
by brian
clean slate |
3159 |
while (*path == FN_LIBCHAR) |
3160 |
path++; |
|
3161 |
}
|
|
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
3162 |
return path; |
1
by brian
clean slate |
3163 |
}
|
3164 |
||
3165 |
||
3166 |
static void fix_paths(void) |
|
3167 |
{
|
|
3168 |
char buff[FN_REFLEN],*pos; |
|
575.4.1
by ysano
Rename mysql to drizzle. |
3169 |
convert_dirname(drizzle_home,drizzle_home,NULL); |
3170 |
/* Resolve symlinks to allow 'drizzle_home' to be a relative symlink */
|
|
3171 |
my_realpath(drizzle_home,drizzle_home,MYF(0)); |
|
3172 |
/* Ensure that drizzle_home ends in FN_LIBCHAR */
|
|
3173 |
pos= strchr(drizzle_home, '\0'); |
|
1
by brian
clean slate |
3174 |
if (pos[-1] != FN_LIBCHAR) |
3175 |
{
|
|
3176 |
pos[0]= FN_LIBCHAR; |
|
3177 |
pos[1]= 0; |
|
3178 |
}
|
|
575.4.1
by ysano
Rename mysql to drizzle. |
3179 |
convert_dirname(drizzle_real_data_home,drizzle_real_data_home,NULL); |
3180 |
(void) fn_format(buff, drizzle_real_data_home, "", "", |
|
1
by brian
clean slate |
3181 |
(MY_RETURN_REAL_PATH|MY_RESOLVE_SYMLINKS)); |
575.4.1
by ysano
Rename mysql to drizzle. |
3182 |
(void) unpack_dirname(drizzle_unpacked_real_data_home, buff); |
461
by Monty Taylor
Removed NullS. bu-bye. |
3183 |
convert_dirname(language,language,NULL); |
856
by Brian Aker
Remove dead code around charset variable/directory. |
3184 |
(void) my_load_path(drizzle_home, drizzle_home,""); // Resolve current dir |
3185 |
(void) my_load_path(drizzle_real_data_home, drizzle_real_data_home,drizzle_home); |
|
3186 |
(void) my_load_path(pidfile_name, pidfile_name,drizzle_real_data_home); |
|
1
by brian
clean slate |
3187 |
(void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr : |
722.1.4
by Monty Taylor
Removed all the setting of DEFS everywhere. Use configmake.h to get the values |
3188 |
get_relative_path(PKGPLUGINDIR), |
3189 |
drizzle_home); |
|
1
by brian
clean slate |
3190 |
opt_plugin_dir_ptr= opt_plugin_dir; |
3191 |
||
856
by Brian Aker
Remove dead code around charset variable/directory. |
3192 |
const char *sharedir= get_relative_path(PKGDATADIR); |
1
by brian
clean slate |
3193 |
if (test_if_hard_path(sharedir)) |
534
by Monty Taylor
Removed stxnmov. Also deleted strstr which had already been removed. |
3194 |
strncpy(buff,sharedir,sizeof(buff)-1); /* purecov: tested */ |
1
by brian
clean slate |
3195 |
else
|
534
by Monty Taylor
Removed stxnmov. Also deleted strstr which had already been removed. |
3196 |
{
|
575.4.1
by ysano
Rename mysql to drizzle. |
3197 |
strcpy(buff, drizzle_home); |
3198 |
strncat(buff, sharedir, sizeof(buff)-strlen(drizzle_home)-1); |
|
534
by Monty Taylor
Removed stxnmov. Also deleted strstr which had already been removed. |
3199 |
}
|
461
by Monty Taylor
Removed NullS. bu-bye. |
3200 |
convert_dirname(buff,buff,NULL); |
1
by brian
clean slate |
3201 |
(void) my_load_path(language,language,buff); |
3202 |
||
680
by Brian Aker
Remove locks around temp tables for searching tmp directory path. |
3203 |
{
|
3204 |
char *tmp_string; |
|
3205 |
struct stat buf; |
|
3206 |
||
3207 |
tmp_string= getenv("TMPDIR"); |
|
3208 |
||
3209 |
if (opt_drizzle_tmpdir) |
|
3210 |
drizzle_tmpdir= strdup(opt_drizzle_tmpdir); |
|
3211 |
else if (tmp_string == NULL) |
|
3212 |
drizzle_tmpdir= strdup(P_tmpdir); |
|
3213 |
else
|
|
3214 |
drizzle_tmpdir= strdup(tmp_string); |
|
3215 |
||
3216 |
assert(drizzle_tmpdir); |
|
3217 |
||
3218 |
if (stat(drizzle_tmpdir, &buf) || (S_ISDIR(buf.st_mode) == false)) |
|
3219 |
{
|
|
3220 |
exit(1); |
|
3221 |
}
|
|
3222 |
}
|
|
3223 |
||
1
by brian
clean slate |
3224 |
/*
|
3225 |
Convert the secure-file-priv option to system format, allowing
|
|
3226 |
a quick strcmp to check if read or write is in an allowed dir
|
|
3227 |
*/
|
|
3228 |
if (opt_secure_file_priv) |
|
3229 |
{
|
|
461
by Monty Taylor
Removed NullS. bu-bye. |
3230 |
convert_dirname(buff, opt_secure_file_priv, NULL); |
477
by Monty Taylor
Removed my_free(). It turns out that it had been def'd to ignore the flags passed to it in the second arg anyway. Gotta love that. |
3231 |
free(opt_secure_file_priv); |
656.1.19
by Monty Taylor
Removed my_strdup from drizzled/ |
3232 |
opt_secure_file_priv= strdup(buff); |
656.1.52
by Monty Taylor
Added more return value checks. |
3233 |
if (opt_secure_file_priv == NULL) |
3234 |
exit(1); |
|
1
by brian
clean slate |
3235 |
}
|
3236 |
}
|
|
3237 |
||
3238 |
||
366
by Patrick Galbraith
Ulong conversion |
3239 |
static uint32_t find_bit_type_or_exit(const char *x, TYPELIB *bit_lib, |
909
by Brian Aker
Remove the need for unireg init |
3240 |
const char *option) |
1
by brian
clean slate |
3241 |
{
|
366
by Patrick Galbraith
Ulong conversion |
3242 |
uint32_t res; |
1
by brian
clean slate |
3243 |
|
3244 |
const char **ptr; |
|
236.1.40
by Monty Taylor
A few meaningless changes. |
3245 |
|
366
by Patrick Galbraith
Ulong conversion |
3246 |
if ((res= find_bit_type(x, bit_lib)) == ~(uint32_t) 0) |
1
by brian
clean slate |
3247 |
{
|
3248 |
ptr= bit_lib->type_names; |
|
3249 |
if (!*x) |
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
3250 |
fprintf(stderr, _("No option given to %s\n"), option); |
1
by brian
clean slate |
3251 |
else
|
312.1.15
by Monty Taylor
Finished marking strings in drizzled.cc. |
3252 |
fprintf(stderr, _("Wrong option to %s. Option(s) given: %s\n"), |
3253 |
option, x); |
|
3254 |
fprintf(stderr, _("Alternatives are: '%s'"), *ptr); |
|
1
by brian
clean slate |
3255 |
while (*++ptr) |
3256 |
fprintf(stderr, ",'%s'", *ptr); |
|
3257 |
fprintf(stderr, "\n"); |
|
3258 |
exit(1); |
|
3259 |
}
|
|
3260 |
return res; |
|
3261 |
}
|
|
3262 |
||
3263 |
||
3264 |
/**
|
|
3265 |
@return
|
|
3266 |
a bitfield from a string of substrings separated by ','
|
|
3267 |
or
|
|
366
by Patrick Galbraith
Ulong conversion |
3268 |
~(uint32_t) 0 on error.
|
1
by brian
clean slate |
3269 |
*/
|
3270 |
||
366
by Patrick Galbraith
Ulong conversion |
3271 |
static uint32_t find_bit_type(const char *x, TYPELIB *bit_lib) |
1
by brian
clean slate |
3272 |
{
|
3273 |
bool found_end; |
|
3274 |
int found_count; |
|
3275 |
const char *end,*i,*j; |
|
3276 |
const char **array, *pos; |
|
366
by Patrick Galbraith
Ulong conversion |
3277 |
uint32_t found,found_int,bit; |
1
by brian
clean slate |
3278 |
|
3279 |
found=0; |
|
3280 |
found_end= 0; |
|
3281 |
pos=(char *) x; |
|
3282 |
while (*pos == ' ') pos++; |
|
3283 |
found_end= *pos == 0; |
|
3284 |
while (!found_end) |
|
3285 |
{
|
|
266.1.14
by Monty Taylor
Removed strcend. |
3286 |
if ((end=strrchr(pos,',')) != NULL) /* Let end point at fieldend */ |
1
by brian
clean slate |
3287 |
{
|
3288 |
while (end > pos && end[-1] == ' ') |
|
3289 |
end--; /* Skip end-space */ |
|
3290 |
found_end=1; |
|
3291 |
}
|
|
266.1.18
by Monty Taylor
Merged. Plus a few fixes. |
3292 |
else
|
3293 |
{
|
|
3294 |
end=pos+strlen(pos); |
|
3295 |
found_end=1; |
|
3296 |
}
|
|
1
by brian
clean slate |
3297 |
found_int=0; found_count=0; |
3298 |
for (array=bit_lib->type_names, bit=1 ; (i= *array++) ; bit<<=1) |
|
3299 |
{
|
|
3300 |
j=pos; |
|
3301 |
while (j != end) |
|
3302 |
{
|
|
3303 |
if (my_toupper(mysqld_charset,*i++) != |
|
3304 |
my_toupper(mysqld_charset,*j++)) |
|
3305 |
goto skip; |
|
3306 |
}
|
|
3307 |
found_int=bit; |
|
3308 |
if (! *i) |
|
3309 |
{
|
|
3310 |
found_count=1; |
|
3311 |
break; |
|
3312 |
}
|
|
3313 |
else if (j != pos) // Half field found |
|
3314 |
{
|
|
3315 |
found_count++; // Could be one of two values |
|
3316 |
}
|
|
3317 |
skip: ; |
|
3318 |
}
|
|
3319 |
if (found_count != 1) |
|
366
by Patrick Galbraith
Ulong conversion |
3320 |
return(~(uint32_t) 0); // No unique value |
1
by brian
clean slate |
3321 |
found|=found_int; |
3322 |
pos=end+1; |
|
3323 |
}
|
|
3324 |
||
51.2.1
by Patrick Galbraith
Removed DBUG_PRINTs, DBUG_ASSERTs, DBUG_EXECUTE_IFs from |
3325 |
return(found); |
1
by brian
clean slate |
3326 |
} /* find_bit_type */ |
3327 |
||
3328 |
||
722.2.12
by Monty Taylor
Removed assert(0); Added function ptr in libdrizzle. |
3329 |
bool safe_read_error_impl(NET *net) |
3330 |
{
|
|
3331 |
if (net->vio) |
|
840.1.19
by Monty Taylor
Renamed vio. |
3332 |
return drizzleclient_vio_was_interrupted(net->vio); |
722.2.12
by Monty Taylor
Removed assert(0); Added function ptr in libdrizzle. |
3333 |
return false; |
3334 |
}
|
|
3335 |
||
1
by brian
clean slate |
3336 |
|
3337 |
/*****************************************************************************
|
|
3338 |
Instantiate templates
|
|
3339 |
*****************************************************************************/
|
|
3340 |
||
3341 |
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
|
|
3342 |
/* Used templates */
|
|
520.1.21
by Brian Aker
THD -> Session rename |
3343 |
template class I_List<Session>; |
3344 |
template class I_List_iterator<Session>; |
|
1
by brian
clean slate |
3345 |
template class I_List<i_string>; |
3346 |
template class I_List<i_string_pair>; |
|
3347 |
template class I_List<NAMED_LIST>; |
|
3348 |
template class I_List<Statement>; |
|
3349 |
template class I_List_iterator<Statement>; |
|
3350 |
#endif
|