~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Monty Taylor
  • Date: 2010-03-11 18:27:20 UTC
  • mfrom: (1333 staging)
  • mto: This revision was merged to the branch mainline in revision 1348.
  • Revision ID: mordred@inaugust.com-20100311182720-hd1h87y6cb1b1mp0
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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,
129
129
 
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);
136
136
 
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);
147
147
 
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
 
                                                  &SV::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);
174
174
 
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);
180
180
 
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);
189
189
 
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);
199
199
 
203
203
                                           fix_server_id);
204
204
 
205
205
static sys_var_session_size_t   sys_sort_buffer(&vars, "sort_buffer_size",
206
 
                                                &SV::sortbuff_size);
 
206
                                                &system_variables::sortbuff_size);
207
207
 
208
208
static sys_var_session_storage_engine sys_storage_engine(&vars, "storage_engine",
209
 
                                       &SV::storage_engine);
 
209
                                       &system_variables::storage_engine);
210
210
static sys_var_const_str        sys_system_time_zone(&vars, "system_time_zone",
211
211
                                             system_time_zone);
212
212
static sys_var_size_t_ptr       sys_table_def_size(&vars, "table_definition_cache",
216
216
static sys_var_uint64_t_ptr     sys_table_lock_wait_timeout(&vars, "table_lock_wait_timeout",
217
217
                                                    &table_lock_wait_timeout);
218
218
static sys_var_session_enum     sys_tx_isolation(&vars, "tx_isolation",
219
 
                                             &SV::tx_isolation,
 
219
                                             &system_variables::tx_isolation,
220
220
                                             &tx_isolation_typelib,
221
221
                                             fix_tx_isolation,
222
222
                                             check_tx_isolation);
223
223
static sys_var_session_uint64_t sys_tmp_table_size(&vars, "tmp_table_size",
224
 
                                           &SV::tmp_table_size);
 
224
                                           &system_variables::tmp_table_size);
225
225
static sys_var_bool_ptr  sys_timed_mutexes(&vars, "timed_mutexes", &internal::timed_mutexes);
226
226
static sys_var_const_str  sys_version(&vars, "version", version().c_str());
227
227
 
261
261
/* Local state variables */
262
262
 
263
263
static sys_var_session_ha_rows  sys_select_limit(&vars, "sql_select_limit",
264
 
                                                 &SV::select_limit);
 
264
                                                 &system_variables::select_limit);
265
265
static sys_var_timestamp sys_timestamp(&vars, "timestamp");
266
266
static sys_var_last_insert_id
267
267
sys_last_insert_id(&vars, "last_insert_id");
295
295
                                          get_warning_count);
296
296
 
297
297
sys_var_session_uint64_t sys_group_concat_max_len(&vars, "group_concat_max_len",
298
 
                                                  &SV::group_concat_max_len);
 
298
                                                  &system_variables::group_concat_max_len);
299
299
 
300
300
sys_var_session_time_zone sys_time_zone(&vars, "time_zone");
301
301
 
309
309
  TODO: remove this list completely
310
310
*/
311
311
 
312
 
#define FIXED_VARS_SIZE (sizeof(fixed_vars) / sizeof(SHOW_VAR))
313
 
static SHOW_VAR fixed_vars[]= {
 
312
#define FIXED_VARS_SIZE (sizeof(fixed_vars) / sizeof(drizzle_show_var))
 
313
static drizzle_show_var fixed_vars[]= {
314
314
  {"back_log",                (char*) &back_log,                SHOW_INT},
315
315
  {"language",                language,                         SHOW_CHAR},
316
316
  {"pid_file",                (char*) pidfile_name,             SHOW_CHAR},
344
344
  Set the OPTION_BIG_SELECTS flag if max_join_size == HA_POS_ERROR.
345
345
*/
346
346
 
347
 
static void fix_max_join_size(Session *session, enum_var_type type)
 
347
static void fix_max_join_size(Session *session, sql_var_t type)
348
348
{
349
349
  if (type != OPT_GLOBAL)
350
350
  {
374
374
  If one doesn't use the SESSION modifier, the isolation level
375
375
  is only active for the next command.
376
376
*/
377
 
static void fix_tx_isolation(Session *session, enum_var_type type)
 
377
static void fix_tx_isolation(Session *session, sql_var_t type)
378
378
{
379
379
  if (type == OPT_SESSION)
380
380
    session->session_tx_isolation= ((enum_tx_isolation)
381
381
                                    session->variables.tx_isolation);
382
382
}
383
383
 
384
 
static void fix_completion_type(Session *, enum_var_type) {}
 
384
static void fix_completion_type(Session *, sql_var_t) {}
385
385
 
386
386
static int check_completion_type(Session *, set_var *var)
387
387
{
396
396
}
397
397
 
398
398
 
399
 
static void fix_session_mem_root(Session *session, enum_var_type type)
 
399
static void fix_session_mem_root(Session *session, sql_var_t type)
400
400
{
401
401
  if (type != OPT_GLOBAL)
402
402
    reset_root_defaults(session->mem_root,
404
404
                        session->variables.query_prealloc_size);
405
405
}
406
406
 
407
 
static void fix_server_id(Session *, enum_var_type)
 
407
 
 
408
static void fix_server_id(Session *, sql_var_t)
408
409
{
409
410
}
410
411
 
513
514
}
514
515
 
515
516
 
516
 
void sys_var_uint32_t_ptr::set_default(Session *, enum_var_type)
 
517
void sys_var_uint32_t_ptr::set_default(Session *, sql_var_t)
517
518
{
518
519
  bool not_used;
519
520
  pthread_mutex_lock(&LOCK_global_system_variables);
540
541
}
541
542
 
542
543
 
543
 
void sys_var_uint64_t_ptr::set_default(Session *, enum_var_type)
 
544
void sys_var_uint64_t_ptr::set_default(Session *, sql_var_t)
544
545
{
545
546
  bool not_used;
546
547
  pthread_mutex_lock(&LOCK_global_system_variables);
563
564
}
564
565
 
565
566
 
566
 
void sys_var_size_t_ptr::set_default(Session *, enum_var_type)
 
567
void sys_var_size_t_ptr::set_default(Session *, sql_var_t)
567
568
{
568
569
  bool not_used;
569
570
  pthread_mutex_lock(&LOCK_global_system_variables);
579
580
}
580
581
 
581
582
 
582
 
void sys_var_bool_ptr::set_default(Session *, enum_var_type)
 
583
void sys_var_bool_ptr::set_default(Session *, sql_var_t)
583
584
{
584
585
  *value= (bool) option_limits->def_value;
585
586
}
622
623
 }
623
624
 
624
625
 
625
 
 void sys_var_session_uint32_t::set_default(Session *session, enum_var_type type)
 
626
 void sys_var_session_uint32_t::set_default(Session *session, sql_var_t type)
626
627
 {
627
628
   if (type == OPT_GLOBAL)
628
629
   {
638
639
 
639
640
 
640
641
unsigned char *sys_var_session_uint32_t::value_ptr(Session *session,
641
 
                                                enum_var_type type,
 
642
                                                sql_var_t type,
642
643
                                                const LEX_STRING *)
643
644
{
644
645
  if (type == OPT_GLOBAL)
670
671
}
671
672
 
672
673
 
673
 
void sys_var_session_ha_rows::set_default(Session *session, enum_var_type type)
 
674
void sys_var_session_ha_rows::set_default(Session *session, sql_var_t type)
674
675
{
675
676
  if (type == OPT_GLOBAL)
676
677
  {
688
689
 
689
690
 
690
691
unsigned char *sys_var_session_ha_rows::value_ptr(Session *session,
691
 
                                                  enum_var_type type,
 
692
                                                  sql_var_t type,
692
693
                                                  const LEX_STRING *)
693
694
{
694
695
  if (type == OPT_GLOBAL)
727
728
}
728
729
 
729
730
 
730
 
void sys_var_session_uint64_t::set_default(Session *session, enum_var_type type)
 
731
void sys_var_session_uint64_t::set_default(Session *session, sql_var_t type)
731
732
{
732
733
  if (type == OPT_GLOBAL)
733
734
  {
744
745
 
745
746
 
746
747
unsigned char *sys_var_session_uint64_t::value_ptr(Session *session,
747
 
                                                   enum_var_type type,
 
748
                                                   sql_var_t type,
748
749
                                                   const LEX_STRING *)
749
750
{
750
751
  if (type == OPT_GLOBAL)
780
781
}
781
782
 
782
783
 
783
 
void sys_var_session_size_t::set_default(Session *session, enum_var_type type)
 
784
void sys_var_session_size_t::set_default(Session *session, sql_var_t type)
784
785
{
785
786
  if (type == OPT_GLOBAL)
786
787
  {
797
798
 
798
799
 
799
800
unsigned char *sys_var_session_size_t::value_ptr(Session *session,
800
 
                                                 enum_var_type type,
 
801
                                                 sql_var_t type,
801
802
                                                 const LEX_STRING *)
802
803
{
803
804
  if (type == OPT_GLOBAL)
816
817
}
817
818
 
818
819
 
819
 
void sys_var_session_bool::set_default(Session *session,  enum_var_type type)
 
820
void sys_var_session_bool::set_default(Session *session,  sql_var_t type)
820
821
{
821
822
  if (type == OPT_GLOBAL)
822
823
    global_system_variables.*offset= (bool) option_limits->def_value;
826
827
 
827
828
 
828
829
unsigned char *sys_var_session_bool::value_ptr(Session *session,
829
 
                                               enum_var_type type,
 
830
                                               sql_var_t type,
830
831
                                               const LEX_STRING *)
831
832
{
832
833
  if (type == OPT_GLOBAL)
881
882
  If type is not given, return local value if exists, else global.
882
883
*/
883
884
 
884
 
Item *sys_var::item(Session *session, enum_var_type var_type, const LEX_STRING *base)
 
885
Item *sys_var::item(Session *session, sql_var_t var_type, const LEX_STRING *base)
885
886
{
886
887
  if (check_type(var_type))
887
888
  {
997
998
}
998
999
 
999
1000
 
1000
 
void sys_var_session_enum::set_default(Session *session, enum_var_type type)
 
1001
void sys_var_session_enum::set_default(Session *session, sql_var_t type)
1001
1002
{
1002
1003
  if (type == OPT_GLOBAL)
1003
1004
    global_system_variables.*offset= (uint32_t) option_limits->def_value;
1007
1008
 
1008
1009
 
1009
1010
unsigned char *sys_var_session_enum::value_ptr(Session *session,
1010
 
                                               enum_var_type type,
 
1011
                                               sql_var_t type,
1011
1012
                                               const LEX_STRING *)
1012
1013
{
1013
1014
  uint32_t tmp= ((type == OPT_GLOBAL) ?
1029
1030
}
1030
1031
 
1031
1032
 
1032
 
unsigned char *sys_var_session_bit::value_ptr(Session *session, enum_var_type,
 
1033
unsigned char *sys_var_session_bit::value_ptr(Session *session, sql_var_t,
1033
1034
                                              const LEX_STRING *)
1034
1035
{
1035
1036
  /*
1094
1095
}
1095
1096
 
1096
1097
 
1097
 
void sys_var_collation_sv::set_default(Session *session, enum_var_type type)
 
1098
void sys_var_collation_sv::set_default(Session *session, sql_var_t type)
1098
1099
{
1099
1100
  if (type == OPT_GLOBAL)
1100
1101
    global_system_variables.*offset= *global_default;
1106
1107
 
1107
1108
 
1108
1109
unsigned char *sys_var_collation_sv::value_ptr(Session *session,
1109
 
                                               enum_var_type type,
 
1110
                                               sql_var_t type,
1110
1111
                                               const LEX_STRING *)
1111
1112
{
1112
1113
  const CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1124
1125
}
1125
1126
 
1126
1127
 
1127
 
void sys_var_timestamp::set_default(Session *session, enum_var_type)
 
1128
void sys_var_timestamp::set_default(Session *session, sql_var_t)
1128
1129
{
1129
1130
  session->user_time=0;
1130
1131
}
1131
1132
 
1132
1133
 
1133
 
unsigned char *sys_var_timestamp::value_ptr(Session *session, enum_var_type,
 
1134
unsigned char *sys_var_timestamp::value_ptr(Session *session, sql_var_t,
1134
1135
                                            const LEX_STRING *)
1135
1136
{
1136
1137
  session->sys_var_tmp.int32_t_value= (int32_t) session->start_time;
1147
1148
 
1148
1149
 
1149
1150
unsigned char *sys_var_last_insert_id::value_ptr(Session *session,
1150
 
                                                 enum_var_type,
 
1151
                                                 sql_var_t,
1151
1152
                                                 const LEX_STRING *)
1152
1153
{
1153
1154
  /*
1191
1192
 
1192
1193
 
1193
1194
unsigned char *sys_var_session_time_zone::value_ptr(Session *session,
1194
 
                                                    enum_var_type type,
 
1195
                                                    sql_var_t type,
1195
1196
                                                    const LEX_STRING *)
1196
1197
{
1197
1198
  /*
1215
1216
}
1216
1217
 
1217
1218
 
1218
 
void sys_var_session_time_zone::set_default(Session *session, enum_var_type type)
 
1219
void sys_var_session_time_zone::set_default(Session *session, sql_var_t type)
1219
1220
{
1220
1221
 pthread_mutex_lock(&LOCK_global_system_variables);
1221
1222
 if (type == OPT_GLOBAL)
1286
1287
 
1287
1288
 
1288
1289
unsigned char *sys_var_session_lc_time_names::value_ptr(Session *session,
1289
 
                                                        enum_var_type type,
 
1290
                                                        sql_var_t type,
1290
1291
                                                        const LEX_STRING *)
1291
1292
{
1292
1293
  return type == OPT_GLOBAL ?
1295
1296
}
1296
1297
 
1297
1298
 
1298
 
void sys_var_session_lc_time_names::set_default(Session *session, enum_var_type type)
 
1299
void sys_var_session_lc_time_names::set_default(Session *session, sql_var_t type)
1299
1300
{
1300
1301
  if (type == OPT_GLOBAL)
1301
1302
    global_system_variables.lc_time_names= my_default_lc_time_names;
1333
1334
}
1334
1335
 
1335
1336
 
1336
 
void sys_var_microseconds::set_default(Session *session, enum_var_type type)
 
1337
void sys_var_microseconds::set_default(Session *session, sql_var_t type)
1337
1338
{
1338
1339
  int64_t microseconds= (int64_t) (option_limits->def_value * 1000000.0);
1339
1340
  if (type == OPT_GLOBAL)
1378
1379
    {
1379
1380
      /* We changed to auto_commit mode */
1380
1381
      session->options&= ~(uint64_t) (OPTION_BEGIN);
1381
 
      session->transaction.all.modified_non_trans_table= false;
1382
1382
      session->server_status|= SERVER_STATUS_AUTOCOMMIT;
1383
1383
      TransactionServices &transaction_services= TransactionServices::singleton();
1384
1384
      if (transaction_services.ha_commit_trans(session, true))
1386
1386
    }
1387
1387
    else
1388
1388
    {
1389
 
      session->transaction.all.modified_non_trans_table= false;
1390
1389
      session->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
1391
1390
    }
1392
1391
  }
1563
1562
    sorted      If TRUE, the system variables should be sorted
1564
1563
 
1565
1564
  RETURN VALUES
1566
 
    pointer     Array of SHOW_VAR elements for display
 
1565
    pointer     Array of drizzle_show_var elements for display
1567
1566
    NULL        FAILURE
1568
1567
*/
1569
1568
 
1570
 
SHOW_VAR* enumerate_sys_vars(Session *session, bool)
 
1569
drizzle_show_var* enumerate_sys_vars(Session *session, bool)
1571
1570
{
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);
1575
1574
 
1576
1575
  if (result)
1577
1576
  {
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));
1580
1579
 
1581
1580
    SystemVariableMap::const_iterator iter= system_variable_map.begin();
1582
1581
    while (iter != system_variable_map.end())
1590
1589
    }
1591
1590
 
1592
1591
    /* make last element empty */
1593
 
    memset(show, 0, sizeof(SHOW_VAR));
 
1592
    memset(show, 0, sizeof(drizzle_show_var));
1594
1593
  }
1595
1594
  return result;
1596
1595
}
1613
1612
 
1614
1613
  for (sys_var *var= vars.first; var; var= var->getNext(), count++) {};
1615
1614
 
1616
 
  if (my_init_dynamic_array(&fixed_show_vars, sizeof(SHOW_VAR),
 
1615
  if (my_init_dynamic_array(&fixed_show_vars, sizeof(drizzle_show_var),
1617
1616
                            FIXED_VARS_SIZE + 64, 64))
1618
1617
    goto error;
1619
1618
 
1638
1637
}
1639
1638
 
1640
1639
 
1641
 
/*
1642
 
  Add elements to the dynamic list of read-only system variables.
1643
 
 
1644
 
  SYNOPSIS
1645
 
    mysql_append_static_vars()
1646
 
    show_vars   Pointer to start of array
1647
 
    count       Number of elements
1648
 
 
1649
 
  RETURN VALUES
1650
 
    0           SUCCESS
1651
 
    otherwise   FAILURE
1652
 
*/
1653
 
int mysql_append_static_vars(const SHOW_VAR *show_vars, uint32_t count)
1654
 
{
1655
 
  for (; count > 0; count--, show_vars++)
1656
 
    if (insert_dynamic(&fixed_show_vars, (unsigned char*) show_vars))
1657
 
      return 1;
1658
 
  return 0;
1659
 
}
1660
 
 
1661
 
 
1662
1640
/**
1663
1641
  Find a user set-table variable.
1664
1642
 
1884
1862
 
1885
1863
 
1886
1864
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session,
1887
 
                                                         enum_var_type type,
 
1865
                                                         sql_var_t type,
1888
1866
                                                         const LEX_STRING *)
1889
1867
{
1890
1868
  unsigned char* result;
1899
1877
}
1900
1878
 
1901
1879
 
1902
 
void sys_var_session_storage_engine::set_default(Session *session, enum_var_type type)
 
1880
void sys_var_session_storage_engine::set_default(Session *session, sql_var_t type)
1903
1881
{
1904
1882
  plugin::StorageEngine *old_value, *new_value, **value;
1905
1883
  if (type == OPT_GLOBAL)