102
102
static bool set_option_autocommit(Session *session, set_var *var);
103
103
static int check_pseudo_thread_id(Session *session, set_var *var);
104
104
static int check_tx_isolation(Session *session, set_var *var);
105
static void fix_tx_isolation(Session *session, enum_var_type type);
105
static void fix_tx_isolation(Session *session, sql_var_t type);
106
106
static int check_completion_type(Session *session, set_var *var);
107
static void fix_completion_type(Session *session, enum_var_type type);
108
static void fix_max_join_size(Session *session, enum_var_type type);
109
static void fix_session_mem_root(Session *session, enum_var_type type);
110
static void fix_server_id(Session *session, enum_var_type type);
107
static void fix_completion_type(Session *session, sql_var_t type);
108
static void fix_max_join_size(Session *session, sql_var_t type);
109
static void fix_session_mem_root(Session *session, sql_var_t type);
110
static void fix_server_id(Session *session, sql_var_t type);
111
111
static bool get_unsigned32(Session *session, set_var *var);
112
112
static bool get_unsigned64(Session *session, set_var *var);
113
113
bool throw_bounds_warning(Session *session, bool fixed, bool unsignd,
130
130
static sys_var_session_uint64_t
131
131
sys_auto_increment_increment(&vars, "auto_increment_increment",
132
&SV::auto_increment_increment);
132
&system_variables::auto_increment_increment);
133
133
static sys_var_session_uint64_t
134
134
sys_auto_increment_offset(&vars, "auto_increment_offset",
135
&SV::auto_increment_offset);
135
&system_variables::auto_increment_offset);
137
137
static sys_var_const_str sys_basedir(&vars, "basedir", drizzle_home);
138
138
static sys_var_session_uint64_t sys_bulk_insert_buff_size(&vars, "bulk_insert_buffer_size",
139
&SV::bulk_insert_buff_size);
139
&system_variables::bulk_insert_buff_size);
140
140
static sys_var_session_uint32_t sys_completion_type(&vars, "completion_type",
141
&SV::completion_type,
141
&system_variables::completion_type,
142
142
check_completion_type,
143
143
fix_completion_type);
144
144
static sys_var_collation_sv
145
sys_collation_server(&vars, "collation_server", &SV::collation_server, &default_charset_info);
145
sys_collation_server(&vars, "collation_server", &system_variables::collation_server, &default_charset_info);
146
146
static sys_var_const_str sys_datadir(&vars, "datadir", drizzle_real_data_home);
148
148
static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",
149
&SV::join_buff_size);
149
&system_variables::join_buff_size);
150
150
static sys_var_session_uint32_t sys_max_allowed_packet(&vars, "max_allowed_packet",
151
&SV::max_allowed_packet);
151
&system_variables::max_allowed_packet);
152
152
static sys_var_uint64_t_ptr sys_max_connect_errors(&vars, "max_connect_errors",
153
153
&max_connect_errors);
154
154
static sys_var_session_uint64_t sys_max_error_count(&vars, "max_error_count",
155
&SV::max_error_count);
155
&system_variables::max_error_count);
156
156
static sys_var_session_uint64_t sys_max_heap_table_size(&vars, "max_heap_table_size",
157
&SV::max_heap_table_size);
157
&system_variables::max_heap_table_size);
158
158
static sys_var_session_uint64_t sys_pseudo_thread_id(&vars, "pseudo_thread_id",
159
&SV::pseudo_thread_id,
159
&system_variables::pseudo_thread_id,
160
160
0, check_pseudo_thread_id);
161
161
static sys_var_session_ha_rows sys_max_join_size(&vars, "max_join_size",
162
&system_variables::max_join_size,
163
163
fix_max_join_size);
164
164
static sys_var_session_uint64_t sys_max_seeks_for_key(&vars, "max_seeks_for_key",
165
&SV::max_seeks_for_key);
165
&system_variables::max_seeks_for_key);
166
166
static sys_var_session_uint64_t sys_max_length_for_sort_data(&vars, "max_length_for_sort_data",
167
&SV::max_length_for_sort_data);
167
&system_variables::max_length_for_sort_data);
168
168
static sys_var_session_size_t sys_max_sort_length(&vars, "max_sort_length",
169
&SV::max_sort_length);
169
&system_variables::max_sort_length);
170
170
static sys_var_uint64_t_ptr sys_max_write_lock_count(&vars, "max_write_lock_count",
171
171
&max_write_lock_count);
172
172
static sys_var_session_uint64_t sys_min_examined_row_limit(&vars, "min_examined_row_limit",
173
&SV::min_examined_row_limit);
173
&system_variables::min_examined_row_limit);
175
175
/* these two cannot be static */
176
176
static sys_var_session_bool sys_optimizer_prune_level(&vars, "optimizer_prune_level",
177
&SV::optimizer_prune_level);
177
&system_variables::optimizer_prune_level);
178
178
static sys_var_session_uint32_t sys_optimizer_search_depth(&vars, "optimizer_search_depth",
179
&SV::optimizer_search_depth);
179
&system_variables::optimizer_search_depth);
181
181
static sys_var_session_uint64_t sys_preload_buff_size(&vars, "preload_buffer_size",
182
&SV::preload_buff_size);
182
&system_variables::preload_buff_size);
183
183
static sys_var_session_uint32_t sys_read_buff_size(&vars, "read_buffer_size",
184
&SV::read_buff_size);
184
&system_variables::read_buff_size);
185
185
static sys_var_session_uint32_t sys_read_rnd_buff_size(&vars, "read_rnd_buffer_size",
186
&SV::read_rnd_buff_size);
186
&system_variables::read_rnd_buff_size);
187
187
static sys_var_session_uint32_t sys_div_precincrement(&vars, "div_precision_increment",
188
&SV::div_precincrement);
188
&system_variables::div_precincrement);
190
190
static sys_var_session_size_t sys_range_alloc_block_size(&vars, "range_alloc_block_size",
191
&SV::range_alloc_block_size);
191
&system_variables::range_alloc_block_size);
192
192
static sys_var_session_uint32_t sys_query_alloc_block_size(&vars, "query_alloc_block_size",
193
&SV::query_alloc_block_size,
193
&system_variables::query_alloc_block_size,
194
194
false, fix_session_mem_root);
195
195
static sys_var_session_uint32_t sys_query_prealloc_size(&vars, "query_prealloc_size",
196
&SV::query_prealloc_size,
196
&system_variables::query_prealloc_size,
197
197
false, fix_session_mem_root);
198
198
static sys_var_readonly sys_tmpdir(&vars, "tmpdir", OPT_GLOBAL, SHOW_CHAR, get_tmpdir);
1563
1562
sorted If TRUE, the system variables should be sorted
1566
pointer Array of SHOW_VAR elements for display
1565
pointer Array of drizzle_show_var elements for display
1570
SHOW_VAR* enumerate_sys_vars(Session *session, bool)
1569
drizzle_show_var* enumerate_sys_vars(Session *session, bool)
1572
1571
int fixed_count= fixed_show_vars.elements;
1573
int size= sizeof(SHOW_VAR) * (system_variable_map.size() + fixed_count + 1);
1574
SHOW_VAR *result= (SHOW_VAR*) session->alloc(size);
1572
int size= sizeof(drizzle_show_var) * (system_variable_map.size() + fixed_count + 1);
1573
drizzle_show_var *result= (drizzle_show_var*) session->alloc(size);
1578
SHOW_VAR *show= result + fixed_count;
1579
memcpy(result, fixed_show_vars.buffer, fixed_count * sizeof(SHOW_VAR));
1577
drizzle_show_var *show= result + fixed_count;
1578
memcpy(result, fixed_show_vars.buffer, fixed_count * sizeof(drizzle_show_var));
1581
1580
SystemVariableMap::const_iterator iter= system_variable_map.begin();
1582
1581
while (iter != system_variable_map.end())