|
1 |
| -/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
| 1 | +/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 2 |
|
3 | 3 | This program is free software; you can redistribute it and/or modify
|
4 | 4 | it under the terms of the GNU General Public License as published by
|
@@ -128,7 +128,11 @@ class Sys_var_integer: public sys_var
|
128 | 128 | option.u_max_value= (uchar**)max_var_ptr();
|
129 | 129 | if (max_var_ptr())
|
130 | 130 | *max_var_ptr()= max_val;
|
131 |
| - global_var(T)= def_val; |
| 131 | + |
| 132 | + // Do not set global_var for Sys_var_keycache objects |
| 133 | + if (offset >= 0) |
| 134 | + global_var(T)= def_val; |
| 135 | + |
132 | 136 | DBUG_ASSERT(size == sizeof(T));
|
133 | 137 | DBUG_ASSERT(min_val < max_val);
|
134 | 138 | DBUG_ASSERT(min_val <= def_val);
|
@@ -726,12 +730,15 @@ class Sys_var_keycache: public Sys_var_ulonglong
|
726 | 730 | on_check_function on_check_func,
|
727 | 731 | keycache_update_function on_update_func,
|
728 | 732 | const char *substitute=0)
|
729 |
| - : Sys_var_ulonglong(name_arg, comment, flag_args, off, size, |
730 |
| - getopt, min_val, max_val, def_val, |
731 |
| - block_size, lock, binlog_status_arg, on_check_func, 0, |
732 |
| - substitute), |
| 733 | + : Sys_var_ulonglong(name_arg, comment, flag_args, |
| 734 | + -1, /* offset, see base class CTOR */ |
| 735 | + size, |
| 736 | + getopt, min_val, max_val, def_val, |
| 737 | + block_size, lock, binlog_status_arg, on_check_func, 0, |
| 738 | + substitute), |
733 | 739 | keycache_update(on_update_func)
|
734 | 740 | {
|
| 741 | + offset= off; /* Remember offset in KEY_CACHE */ |
735 | 742 | option.var_type|= GET_ASK_ADDR;
|
736 | 743 | option.value= (uchar**)1; // crash me, please
|
737 | 744 | keycache_var(dflt_key_cache, off)= def_val;
|
|
0 commit comments