~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/set_var.cc

  • Committer: Brian Aker
  • Date: 2008-07-26 18:39:33 UTC
  • mfrom: (212.1.3 codestyle)
  • Revision ID: brian@tangent.org-20080726183933-hueup0fcy2zs1hug
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
635
635
};
636
636
 
637
637
 
638
 
bool sys_var::check(THD *thd __attribute__((__unused__)), set_var *var)
 
638
bool sys_var::check(THD *thd __attribute__((unused)), set_var *var)
639
639
{
640
640
  var->save_result.uint64_t_value= var->value->val_int();
641
641
  return 0;
689
689
}
690
690
 
691
691
 
692
 
static bool sys_update_init_connect(THD *thd __attribute__((__unused__)), set_var *var)
 
692
static bool sys_update_init_connect(THD *thd __attribute__((unused)), set_var *var)
693
693
{
694
694
  return update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, var);
695
695
}
696
696
 
697
697
 
698
 
static void sys_default_init_connect(THD* thd __attribute__((__unused__)),
699
 
                                     enum_var_type type __attribute__((__unused__)))
 
698
static void sys_default_init_connect(THD* thd __attribute__((unused)),
 
699
                                     enum_var_type type __attribute__((unused)))
700
700
{
701
701
  update_sys_var_str(&sys_init_connect, &LOCK_sys_init_connect, 0);
702
702
}
703
703
 
704
704
 
705
 
static bool sys_update_init_slave(THD *thd __attribute__((__unused__)),
 
705
static bool sys_update_init_slave(THD *thd __attribute__((unused)),
706
706
                                  set_var *var)
707
707
{
708
708
  return update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, var);
709
709
}
710
710
 
711
711
 
712
 
static void sys_default_init_slave(THD* thd __attribute__((__unused__)),
713
 
                                   enum_var_type type __attribute__((__unused__)))
 
712
static void sys_default_init_slave(THD* thd __attribute__((unused)),
 
713
                                   enum_var_type type __attribute__((unused)))
714
714
{
715
715
  update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0);
716
716
}
734
734
 
735
735
 
736
736
static void
737
 
fix_myisam_max_sort_file_size(THD *thd __attribute__((__unused__)),
738
 
                              enum_var_type type __attribute__((__unused__)))
 
737
fix_myisam_max_sort_file_size(THD *thd __attribute__((unused)),
 
738
                              enum_var_type type __attribute__((unused)))
739
739
{
740
740
  myisam_max_temp_length=
741
741
    (my_off_t) global_system_variables.myisam_max_sort_file_size;
785
785
static void fix_completion_type(THD *thd __attribute__((unused)),
786
786
                                enum_var_type type __attribute__((unused))) {}
787
787
 
788
 
static int check_completion_type(THD *thd __attribute__((__unused__)),
 
788
static int check_completion_type(THD *thd __attribute__((unused)),
789
789
                                 set_var *var)
790
790
{
791
791
  int64_t val= var->value->val_int();
835
835
#endif /* HAVE_REPLICATION */
836
836
 
837
837
 
838
 
extern void fix_delay_key_write(THD *thd __attribute__((__unused__)),
839
 
                                enum_var_type type __attribute__((__unused__)))
 
838
extern void fix_delay_key_write(THD *thd __attribute__((unused)),
 
839
                                enum_var_type type __attribute__((unused)))
840
840
{
841
841
  switch ((enum_delay_key_write) delay_key_write_options) {
842
842
  case DELAY_KEY_WRITE_NONE:
852
852
  }
853
853
}
854
854
 
855
 
bool sys_var_set::update(THD *thd __attribute__((__unused__)),
 
855
bool sys_var_set::update(THD *thd __attribute__((unused)),
856
856
                         set_var *var)
857
857
{
858
858
  *value= var->save_result.ulong_value;
860
860
}
861
861
 
862
862
uchar *sys_var_set::value_ptr(THD *thd,
863
 
                              enum_var_type type __attribute__((__unused__)),
864
 
                              LEX_STRING *base __attribute__((__unused__)))
 
863
                              enum_var_type type __attribute__((unused)),
 
864
                              LEX_STRING *base __attribute__((unused)))
865
865
{
866
866
  char buff[256];
867
867
  String tmp(buff, sizeof(buff), &my_charset_latin1);
884
884
  return (uchar*) thd->strmake(tmp.ptr(), length);
885
885
}
886
886
 
887
 
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((__unused__)),
888
 
                                         enum_var_type type __attribute__((__unused__)))
 
887
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((unused)),
 
888
                                         enum_var_type type __attribute__((unused)))
889
889
{
890
890
  slave_exec_mode_options= 0;
891
891
  bit_do_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT);
913
913
  return rc;
914
914
}
915
915
 
916
 
void fix_slave_exec_mode(enum_var_type type __attribute__((__unused__)))
 
916
void fix_slave_exec_mode(enum_var_type type __attribute__((unused)))
917
917
{
918
918
  if (bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_STRICT) == 1 &&
919
919
      bit_is_set(slave_exec_mode_options, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
962
962
 
963
963
 
964
964
void fix_binlog_format_after_update(THD *thd,
965
 
                                    enum_var_type type __attribute__((__unused__)))
 
965
                                    enum_var_type type __attribute__((unused)))
966
966
{
967
967
  thd->reset_current_stmt_binlog_row_based();
968
968
}
969
969
 
970
970
 
971
 
static void fix_max_binlog_size(THD *thd __attribute__((__unused__)),
972
 
                                enum_var_type type __attribute__((__unused__)))
 
971
static void fix_max_binlog_size(THD *thd __attribute__((unused)),
 
972
                                enum_var_type type __attribute__((unused)))
973
973
{
974
974
  mysql_bin_log.set_max_size(max_binlog_size);
975
975
#ifdef HAVE_REPLICATION
979
979
  return;
980
980
}
981
981
 
982
 
static void fix_max_relay_log_size(THD *thd __attribute__((__unused__)),
983
 
                                   enum_var_type type __attribute__((__unused__)))
 
982
static void fix_max_relay_log_size(THD *thd __attribute__((unused)),
 
983
                                   enum_var_type type __attribute__((unused)))
984
984
{
985
985
#ifdef HAVE_REPLICATION
986
986
  active_mi->rli.relay_log.set_max_size(max_relay_log_size ?
989
989
  return;
990
990
}
991
991
 
992
 
static void fix_max_connections(THD *thd __attribute__((__unused__)),
993
 
                                enum_var_type type __attribute__((__unused__)))
 
992
static void fix_max_connections(THD *thd __attribute__((unused)),
 
993
                                enum_var_type type __attribute__((unused)))
994
994
{
995
995
  resize_thr_alarm(max_connections +  10);
996
996
}
1014
1014
}
1015
1015
 
1016
1016
 
1017
 
static void fix_server_id(THD *thd __attribute__((__unused__)),
1018
 
                          enum_var_type type __attribute__((__unused__)))
 
1017
static void fix_server_id(THD *thd __attribute__((unused)),
 
1018
                          enum_var_type type __attribute__((unused)))
1019
1019
{
1020
1020
  server_id_supplied = 1;
1021
1021
  thd->server_id= server_id;
1051
1051
  return out;
1052
1052
}
1053
1053
 
1054
 
static bool get_unsigned(THD *thd __attribute__((__unused__)), set_var *var)
 
1054
static bool get_unsigned(THD *thd __attribute__((unused)), set_var *var)
1055
1055
{
1056
1056
  if (var->value->unsigned_flag)
1057
1057
    var->save_result.uint64_t_value= (uint64_t) var->value->val_int();
1102
1102
}
1103
1103
 
1104
1104
 
1105
 
void sys_var_long_ptr_global::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
 
1105
void sys_var_long_ptr_global::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1106
1106
{
1107
1107
  bool not_used;
1108
1108
  pthread_mutex_lock(guard);
1125
1125
}
1126
1126
 
1127
1127
 
1128
 
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((__unused__)),
1129
 
                                        enum_var_type type __attribute__((__unused__)))
 
1128
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((unused)),
 
1129
                                        enum_var_type type __attribute__((unused)))
1130
1130
{
1131
1131
  bool not_used;
1132
1132
  pthread_mutex_lock(&LOCK_global_system_variables);
1136
1136
}
1137
1137
 
1138
1138
 
1139
 
bool sys_var_bool_ptr::update(THD *thd __attribute__((__unused__)), set_var *var)
 
1139
bool sys_var_bool_ptr::update(THD *thd __attribute__((unused)), set_var *var)
1140
1140
{
1141
1141
  *value= (bool) var->save_result.ulong_value;
1142
1142
  return 0;
1143
1143
}
1144
1144
 
1145
1145
 
1146
 
void sys_var_bool_ptr::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
 
1146
void sys_var_bool_ptr::set_default(THD *thd __attribute__((unused)), enum_var_type type __attribute__((unused)))
1147
1147
{
1148
1148
  *value= (bool) option_limits->def_value;
1149
1149
}
1150
1150
 
1151
1151
 
1152
 
bool sys_var_enum::update(THD *thd __attribute__((__unused__)), set_var *var)
 
1152
bool sys_var_enum::update(THD *thd __attribute__((unused)), set_var *var)
1153
1153
{
1154
1154
  *value= (uint) var->save_result.ulong_value;
1155
1155
  return 0;
1156
1156
}
1157
1157
 
1158
1158
 
1159
 
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((__unused__)),
1160
 
                               enum_var_type type __attribute__((__unused__)),
1161
 
                               LEX_STRING *base __attribute__((__unused__)))
 
1159
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
 
1160
                               enum_var_type type __attribute__((unused)),
 
1161
                               LEX_STRING *base __attribute__((unused)))
1162
1162
{
1163
1163
  return (uchar*) enum_names->type_names[*value];
1164
1164
}
1165
1165
 
1166
1166
 
1167
 
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((__unused__)),
1168
 
                                     enum_var_type type __attribute__((__unused__)),
1169
 
                                     LEX_STRING *base __attribute__((__unused__)))
 
1167
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((unused)),
 
1168
                                     enum_var_type type __attribute__((unused)),
 
1169
                                     LEX_STRING *base __attribute__((unused)))
1170
1170
{
1171
1171
  return (uchar*) enum_names->type_names[global_system_variables.*offset];
1172
1172
}
1223
1223
 
1224
1224
 
1225
1225
uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1226
 
                                    LEX_STRING *base __attribute__((__unused__)))
 
1226
                                    LEX_STRING *base __attribute__((unused)))
1227
1227
{
1228
1228
  if (type == OPT_GLOBAL)
1229
1229
    return (uchar*) &(global_system_variables.*offset);
1272
1272
 
1273
1273
 
1274
1274
uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1275
 
                                      LEX_STRING *base __attribute__((__unused__)))
 
1275
                                      LEX_STRING *base __attribute__((unused)))
1276
1276
{
1277
1277
  if (type == OPT_GLOBAL)
1278
1278
    return (uchar*) &(global_system_variables.*offset);
1323
1323
 
1324
1324
 
1325
1325
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1326
 
                                        LEX_STRING *base __attribute__((__unused__)))
 
1326
                                        LEX_STRING *base __attribute__((unused)))
1327
1327
{
1328
1328
  if (type == OPT_GLOBAL)
1329
1329
    return (uchar*) &(global_system_variables.*offset);
1351
1351
 
1352
1352
 
1353
1353
uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1354
 
                                   LEX_STRING *base __attribute__((__unused__)))
 
1354
                                   LEX_STRING *base __attribute__((unused)))
1355
1355
{
1356
1356
  if (type == OPT_GLOBAL)
1357
1357
    return (uchar*) &(global_system_variables.*offset);
1359
1359
}
1360
1360
 
1361
1361
 
1362
 
bool sys_var::check_enum(THD *thd __attribute__((__unused__)),
 
1362
bool sys_var::check_enum(THD *thd __attribute__((unused)),
1363
1363
                         set_var *var, const TYPELIB *enum_names)
1364
1364
{
1365
1365
  char buff[STRING_BUFFER_USUAL_SIZE];
1396
1396
}
1397
1397
 
1398
1398
 
1399
 
bool sys_var::check_set(THD *thd __attribute__((__unused__)),
 
1399
bool sys_var::check_set(THD *thd __attribute__((unused)),
1400
1400
                        set_var *var, TYPELIB *enum_names)
1401
1401
{
1402
1402
  bool not_used;
1596
1596
 
1597
1597
 
1598
1598
uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1599
 
                                   LEX_STRING *base __attribute__((__unused__)))
 
1599
                                   LEX_STRING *base __attribute__((unused)))
1600
1600
{
1601
1601
  ulong tmp= ((type == OPT_GLOBAL) ?
1602
1602
              global_system_variables.*offset :
1618
1618
 
1619
1619
 
1620
1620
uchar *sys_var_thd_bit::value_ptr(THD *thd,
1621
 
                                  enum_var_type type __attribute__((__unused__)),
1622
 
                                  LEX_STRING *base __attribute__((__unused__)))
 
1621
                                  enum_var_type type __attribute__((unused)),
 
1622
                                  LEX_STRING *base __attribute__((unused)))
1623
1623
{
1624
1624
  /*
1625
1625
    If reverse is 0 (default) return 1 if bit is set.
1716
1716
 
1717
1717
 
1718
1718
uchar *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
1719
 
                                               LEX_STRING *base __attribute__((__unused__)))
 
1719
                                               LEX_STRING *base __attribute__((unused)))
1720
1720
{
1721
1721
  if (type == OPT_GLOBAL)
1722
1722
  {
1768
1768
}
1769
1769
 
1770
1770
 
1771
 
bool sys_var_collation::check(THD *thd __attribute__((__unused__)),
 
1771
bool sys_var_collation::check(THD *thd __attribute__((unused)),
1772
1772
                              set_var *var)
1773
1773
{
1774
1774
  CHARSET_INFO *tmp;
1803
1803
}
1804
1804
 
1805
1805
 
1806
 
bool sys_var_character_set::check(THD *thd __attribute__((__unused__)),
 
1806
bool sys_var_character_set::check(THD *thd __attribute__((unused)),
1807
1807
                                  set_var *var)
1808
1808
{
1809
1809
  CHARSET_INFO *tmp;
1852
1852
 
1853
1853
 
1854
1854
uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1855
 
                                        LEX_STRING *base __attribute__((__unused__)))
 
1855
                                        LEX_STRING *base __attribute__((unused)))
1856
1856
{
1857
1857
  CHARSET_INFO *cs= ci_ptr(thd,type)[0];
1858
1858
  return cs ? (uchar*) cs->csname : (uchar*) NULL;
1941
1941
 
1942
1942
 
1943
1943
uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1944
 
                                       LEX_STRING *base __attribute__((__unused__)))
 
1944
                                       LEX_STRING *base __attribute__((unused)))
1945
1945
{
1946
1946
  CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1947
1947
                     global_system_variables.*offset : thd->variables.*offset);
1963
1963
}
1964
1964
 
1965
1965
 
1966
 
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((__unused__)),
1967
 
                                          enum_var_type type __attribute__((__unused__)),
1968
 
                                          LEX_STRING *base __attribute__((__unused__)))
 
1966
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((unused)),
 
1967
                                          enum_var_type type __attribute__((unused)),
 
1968
                                          LEX_STRING *base __attribute__((unused)))
1969
1969
{
1970
1970
  KEY_CACHE *key_cache= get_key_cache(base);
1971
1971
  if (!key_cache)
2132
2132
}
2133
2133
 
2134
2134
void sys_var_log_state::set_default(THD *thd,
2135
 
                                    enum_var_type type __attribute__((__unused__)))
 
2135
                                    enum_var_type type __attribute__((unused)))
2136
2136
{
2137
2137
  pthread_mutex_lock(&LOCK_global_system_variables);
2138
2138
  logger.deactivate_log_handler(thd, log_type);
2140
2140
}
2141
2141
 
2142
2142
 
2143
 
static int  sys_check_log_path(THD *thd __attribute__((__unused__)),
 
2143
static int  sys_check_log_path(THD *thd __attribute__((unused)),
2144
2144
                               set_var *var)
2145
2145
{
2146
2146
  char path[FN_REFLEN], buff[FN_REFLEN];
2201
2201
}
2202
2202
 
2203
2203
 
2204
 
bool update_sys_var_str_path(THD *thd __attribute__((__unused__)),
 
2204
bool update_sys_var_str_path(THD *thd __attribute__((unused)),
2205
2205
                             sys_var_str *var_str,
2206
2206
                             set_var *var, const char *log_ext,
2207
2207
                             bool log_state, uint log_type)
2273
2273
 
2274
2274
 
2275
2275
static void sys_default_general_log_path(THD *thd,
2276
 
                                         enum_var_type type __attribute__((__unused__)))
 
2276
                                         enum_var_type type __attribute__((unused)))
2277
2277
{
2278
2278
  (void) update_sys_var_str_path(thd, &sys_var_general_log_path,
2279
2279
                                 0, ".log", opt_log, QUERY_LOG_GENERAL);
2289
2289
 
2290
2290
 
2291
2291
static void sys_default_slow_log_path(THD *thd,
2292
 
                                      enum_var_type type __attribute__((__unused__)))
 
2292
                                      enum_var_type type __attribute__((unused)))
2293
2293
{
2294
2294
  (void) update_sys_var_str_path(thd, &sys_var_slow_log_path,
2295
2295
                                 0, "-slow.log", opt_slow_log,
2297
2297
}
2298
2298
 
2299
2299
 
2300
 
bool sys_var_log_output::update(THD *thd __attribute__((__unused__)),
 
2300
bool sys_var_log_output::update(THD *thd __attribute__((unused)),
2301
2301
                                set_var *var)
2302
2302
{
2303
2303
  pthread_mutex_lock(&LOCK_global_system_variables);
2311
2311
}
2312
2312
 
2313
2313
 
2314
 
void sys_var_log_output::set_default(THD *thd __attribute__((__unused__)),
2315
 
                                     enum_var_type type __attribute__((__unused__)))
 
2314
void sys_var_log_output::set_default(THD *thd __attribute__((unused)),
 
2315
                                     enum_var_type type __attribute__((unused)))
2316
2316
{
2317
2317
  pthread_mutex_lock(&LOCK_global_system_variables);
2318
2318
  logger.lock_exclusive();
2325
2325
 
2326
2326
 
2327
2327
uchar *sys_var_log_output::value_ptr(THD *thd,
2328
 
                                     enum_var_type type __attribute__((__unused__)),
2329
 
                                     LEX_STRING *base __attribute__((__unused__)))
 
2328
                                     enum_var_type type __attribute__((unused)),
 
2329
                                     LEX_STRING *base __attribute__((unused)))
2330
2330
{
2331
2331
  char buff[256];
2332
2332
  String tmp(buff, sizeof(buff), &my_charset_latin1);
2354
2354
  Functions to handle SET NAMES and SET CHARACTER SET
2355
2355
*****************************************************************************/
2356
2356
 
2357
 
int set_var_collation_client::check(THD *thd __attribute__((__unused__)))
 
2357
int set_var_collation_client::check(THD *thd __attribute__((unused)))
2358
2358
{
2359
2359
  /* Currently, UCS-2 cannot be used as a client character set */
2360
2360
  if (character_set_client->mbminlen > 1)
2386
2386
 
2387
2387
 
2388
2388
void sys_var_timestamp::set_default(THD *thd,
2389
 
                                    enum_var_type type __attribute__((__unused__)))
 
2389
                                    enum_var_type type __attribute__((unused)))
2390
2390
{
2391
2391
  thd->user_time=0;
2392
2392
}
2393
2393
 
2394
2394
 
2395
2395
uchar *sys_var_timestamp::value_ptr(THD *thd,
2396
 
                                    enum_var_type type __attribute__((__unused__)),
2397
 
                                    LEX_STRING *base __attribute__((__unused__)))
 
2396
                                    enum_var_type type __attribute__((unused)),
 
2397
                                    LEX_STRING *base __attribute__((unused)))
2398
2398
{
2399
2399
  thd->sys_var_tmp.long_value= (long) thd->start_time;
2400
2400
  return (uchar*) &thd->sys_var_tmp.long_value;
2410
2410
 
2411
2411
 
2412
2412
uchar *sys_var_last_insert_id::value_ptr(THD *thd,
2413
 
                                         enum_var_type type __attribute__((__unused__)),
2414
 
                                         LEX_STRING *base __attribute__((__unused__)))
 
2413
                                         enum_var_type type __attribute__((unused)),
 
2414
                                         LEX_STRING *base __attribute__((unused)))
2415
2415
{
2416
2416
  /*
2417
2417
    this tmp var makes it robust againt change of type of
2431
2431
 
2432
2432
 
2433
2433
uchar *sys_var_insert_id::value_ptr(THD *thd,
2434
 
                                    enum_var_type type __attribute__((__unused__)),
2435
 
                                    LEX_STRING *base __attribute__((__unused__)))
 
2434
                                    enum_var_type type __attribute__((unused)),
 
2435
                                    LEX_STRING *base __attribute__((unused)))
2436
2436
{
2437
2437
  thd->sys_var_tmp.uint64_t_value=
2438
2438
    thd->auto_inc_intervals_forced.minimum();
2484
2484
 
2485
2485
 
2486
2486
uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2487
 
                                        LEX_STRING *base __attribute__((__unused__)))
 
2487
                                        LEX_STRING *base __attribute__((unused)))
2488
2488
{
2489
2489
  /* 
2490
2490
    We can use ptr() instead of c_ptr() here because String contaning
2546
2546
  }
2547
2547
}
2548
2548
 
2549
 
bool sys_var_max_user_conn::update(THD *thd __attribute__((__unused__)),
 
2549
bool sys_var_max_user_conn::update(THD *thd __attribute__((unused)),
2550
2550
                                   set_var *var)
2551
2551
{
2552
2552
  assert(var->type == OPT_GLOBAL);
2557
2557
}
2558
2558
 
2559
2559
 
2560
 
void sys_var_max_user_conn::set_default(THD *thd __attribute__((__unused__)),
2561
 
                                        enum_var_type type __attribute__((__unused__)))
 
2560
void sys_var_max_user_conn::set_default(THD *thd __attribute__((unused)),
 
2561
                                        enum_var_type type __attribute__((unused)))
2562
2562
{
2563
2563
  assert(type == OPT_GLOBAL);
2564
2564
  pthread_mutex_lock(&LOCK_global_system_variables);
2568
2568
 
2569
2569
 
2570
2570
uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2571
 
                                        LEX_STRING *base __attribute__((__unused__)))
 
2571
                                        LEX_STRING *base __attribute__((unused)))
2572
2572
{
2573
2573
  if (type != OPT_GLOBAL &&
2574
2574
      thd->user_connect && thd->user_connect->user_resources.user_conn)
2577
2577
}
2578
2578
 
2579
2579
 
2580
 
bool sys_var_thd_lc_time_names::check(THD *thd __attribute__((__unused__)),
 
2580
bool sys_var_thd_lc_time_names::check(THD *thd __attribute__((unused)),
2581
2581
                                      set_var *var)
2582
2582
{
2583
2583
  MY_LOCALE *locale_match;
2627
2627
 
2628
2628
uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2629
2629
                                            enum_var_type type,
2630
 
                                            LEX_STRING *base __attribute__((__unused__)))
 
2630
                                            LEX_STRING *base __attribute__((unused)))
2631
2631
{
2632
2632
  return type == OPT_GLOBAL ?
2633
2633
                 (uchar *) global_system_variables.lc_time_names->name :
2688
2688
 
2689
2689
 
2690
2690
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2691
 
                                          LEX_STRING *base __attribute__((__unused__)))
 
2691
                                          LEX_STRING *base __attribute__((unused)))
2692
2692
{
2693
2693
  thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2694
2694
                                   global_system_variables.*offset :
2743
2743
  return 0;
2744
2744
}
2745
2745
 
2746
 
static int check_log_update(THD *thd __attribute__((__unused__)),
2747
 
                            set_var *var __attribute__((__unused__)))
 
2746
static int check_log_update(THD *thd __attribute__((unused)),
 
2747
                            set_var *var __attribute__((unused)))
2748
2748
{
2749
2749
  return 0;
2750
2750
}
2751
2751
 
2752
 
static bool set_log_update(THD *thd __attribute__((__unused__)),
2753
 
                           set_var *var __attribute__((__unused__)))
 
2752
static bool set_log_update(THD *thd __attribute__((unused)),
 
2753
                           set_var *var __attribute__((unused)))
2754
2754
{
2755
2755
  /*
2756
2756
    The update log is not supported anymore since 5.0.
2773
2773
}
2774
2774
 
2775
2775
 
2776
 
static int check_pseudo_thread_id(THD *thd __attribute__((__unused__)),
 
2776
static int check_pseudo_thread_id(THD *thd __attribute__((unused)),
2777
2777
                                  set_var *var)
2778
2778
{
2779
2779
  var->save_result.uint64_t_value= var->value->val_int();
2811
2811
  @retval
2812
2812
    ptr         pointer to NUL-terminated string
2813
2813
*/
2814
 
static uchar *get_tmpdir(THD *thd __attribute__((__unused__)))
 
2814
static uchar *get_tmpdir(THD *thd __attribute__((unused)))
2815
2815
{
2816
2816
  if (opt_mysql_tmpdir)
2817
2817
    return (uchar *)opt_mysql_tmpdir;
2862
2862
*/
2863
2863
 
2864
2864
static uchar *get_sys_var_length(const sys_var *var, size_t *length,
2865
 
                                 bool first __attribute__((__unused__)))
 
2865
                                 bool first __attribute__((unused)))
2866
2866
{
2867
2867
  *length= var->name_length;
2868
2868
  return (uchar*) var->name;
3234
3234
}
3235
3235
 
3236
3236
 
3237
 
int set_var_user::update(THD *thd __attribute__((__unused__)))
 
3237
int set_var_user::update(THD *thd __attribute__((unused)))
3238
3238
{
3239
3239
  if (user_var_item->update())
3240
3240
  {
3283
3283
 
3284
3284
 
3285
3285
uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
3286
 
                                             LEX_STRING *base __attribute__((__unused__)))
 
3286
                                             LEX_STRING *base __attribute__((unused)))
3287
3287
{
3288
3288
  uchar* result;
3289
3289
  handlerton *hton;
3365
3365
 
3366
3366
 
3367
3367
uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3368
 
                                               LEX_STRING *base __attribute__((__unused__)))
 
3368
                                               LEX_STRING *base __attribute__((unused)))
3369
3369
{
3370
3370
  LEX_STRING opts;
3371
3371
  uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
3465
3465
}
3466
3466
 
3467
3467
 
3468
 
void free_key_cache(const char *name __attribute__((__unused__)),
 
3468
void free_key_cache(const char *name __attribute__((unused)),
3469
3469
                    KEY_CACHE *key_cache)
3470
3470
{
3471
3471
  ha_end_key_cache(key_cache);