~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 05:57:49 UTC
  • Revision ID: brian@tangent.org-20081006055749-svg700gciuqi0zu1
Remove all of uchar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
113
113
                          const char *name, int64_t val);
114
114
static KEY_CACHE *create_key_cache(const char *name, uint length);
115
 
static uchar *get_error_count(THD *thd);
116
 
static uchar *get_warning_count(THD *thd);
117
 
static uchar *get_tmpdir(THD *thd);
 
115
static unsigned char *get_error_count(THD *thd);
 
116
static unsigned char *get_warning_count(THD *thd);
 
117
static unsigned char *get_tmpdir(THD *thd);
118
118
 
119
119
/*
120
120
  Variable definition list
523
523
static sys_var_const_str_ptr    sys_repl_report_user(&vars, "report_user", &report_user);
524
524
static sys_var_const_str_ptr    sys_repl_report_password(&vars, "report_password", &report_password);
525
525
 
526
 
static uchar *slave_get_report_port(THD *thd)
 
526
static unsigned char *slave_get_report_port(THD *thd)
527
527
{
528
528
  thd->sys_var_tmp.long_value= report_port;
529
 
  return (uchar*) &thd->sys_var_tmp.long_value;
 
529
  return (unsigned char*) &thd->sys_var_tmp.long_value;
530
530
}
531
531
 
532
532
static sys_var_readonly    sys_repl_report_port(&vars, "report_port", OPT_GLOBAL, SHOW_INT, slave_get_report_port);
776
776
  return 0;
777
777
}
778
778
 
779
 
uchar *sys_var_set::value_ptr(THD *thd,
 
779
unsigned char *sys_var_set::value_ptr(THD *thd,
780
780
                              enum_var_type type __attribute__((unused)),
781
781
                              LEX_STRING *base __attribute__((unused)))
782
782
{
798
798
 
799
799
  if ((length= tmp.length()))
800
800
    length--;
801
 
  return (uchar*) thd->strmake(tmp.ptr(), length);
 
801
  return (unsigned char*) thd->strmake(tmp.ptr(), length);
802
802
}
803
803
 
804
804
void sys_var_set_slave_mode::set_default(THD *thd __attribute__((unused)),
1069
1069
}
1070
1070
 
1071
1071
 
1072
 
uchar *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
 
1072
unsigned char *sys_var_enum::value_ptr(THD *thd __attribute__((unused)),
1073
1073
                               enum_var_type type __attribute__((unused)),
1074
1074
                               LEX_STRING *base __attribute__((unused)))
1075
1075
{
1076
 
  return (uchar*) enum_names->type_names[*value];
 
1076
  return (unsigned char*) enum_names->type_names[*value];
1077
1077
}
1078
1078
 
1079
1079
 
1080
 
uchar *sys_var_enum_const::value_ptr(THD *thd __attribute__((unused)),
 
1080
unsigned char *sys_var_enum_const::value_ptr(THD *thd __attribute__((unused)),
1081
1081
                                     enum_var_type type __attribute__((unused)),
1082
1082
                                     LEX_STRING *base __attribute__((unused)))
1083
1083
{
1084
 
  return (uchar*) enum_names->type_names[global_system_variables.*offset];
 
1084
  return (unsigned char*) enum_names->type_names[global_system_variables.*offset];
1085
1085
}
1086
1086
 
1087
1087
bool sys_var_thd_ulong::check(THD *thd, set_var *var)
1135
1135
 }
1136
1136
 
1137
1137
 
1138
 
uchar *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
 
1138
unsigned char *sys_var_thd_ulong::value_ptr(THD *thd, enum_var_type type,
1139
1139
                                    LEX_STRING *base __attribute__((unused)))
1140
1140
{
1141
1141
  if (type == OPT_GLOBAL)
1142
 
    return (uchar*) &(global_system_variables.*offset);
1143
 
  return (uchar*) &(thd->variables.*offset);
 
1142
    return (unsigned char*) &(global_system_variables.*offset);
 
1143
  return (unsigned char*) &(thd->variables.*offset);
1144
1144
}
1145
1145
 
1146
1146
 
1184
1184
}
1185
1185
 
1186
1186
 
1187
 
uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
 
1187
unsigned char *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
1188
1188
                                      LEX_STRING *base __attribute__((unused)))
1189
1189
{
1190
1190
  if (type == OPT_GLOBAL)
1191
 
    return (uchar*) &(global_system_variables.*offset);
1192
 
  return (uchar*) &(thd->variables.*offset);
 
1191
    return (unsigned char*) &(global_system_variables.*offset);
 
1192
  return (unsigned char*) &(thd->variables.*offset);
1193
1193
}
1194
1194
 
1195
1195
bool sys_var_thd_uint64_t::check(THD *thd, set_var *var)
1235
1235
}
1236
1236
 
1237
1237
 
1238
 
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
 
1238
unsigned char *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1239
1239
                                        LEX_STRING *base __attribute__((unused)))
1240
1240
{
1241
1241
  if (type == OPT_GLOBAL)
1242
 
    return (uchar*) &(global_system_variables.*offset);
1243
 
  return (uchar*) &(thd->variables.*offset);
 
1242
    return (unsigned char*) &(global_system_variables.*offset);
 
1243
  return (unsigned char*) &(thd->variables.*offset);
1244
1244
}
1245
1245
 
1246
1246
 
1263
1263
}
1264
1264
 
1265
1265
 
1266
 
uchar *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
 
1266
unsigned char *sys_var_thd_bool::value_ptr(THD *thd, enum_var_type type,
1267
1267
                                   LEX_STRING *base __attribute__((unused)))
1268
1268
{
1269
1269
  if (type == OPT_GLOBAL)
1270
 
    return (uchar*) &(global_system_variables.*offset);
1271
 
  return (uchar*) &(thd->variables.*offset);
 
1270
    return (unsigned char*) &(global_system_variables.*offset);
 
1271
  return (unsigned char*) &(thd->variables.*offset);
1272
1272
}
1273
1273
 
1274
1274
 
1508
1508
}
1509
1509
 
1510
1510
 
1511
 
uchar *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
 
1511
unsigned char *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type,
1512
1512
                                   LEX_STRING *base __attribute__((unused)))
1513
1513
{
1514
1514
  ulong tmp= ((type == OPT_GLOBAL) ?
1515
1515
              global_system_variables.*offset :
1516
1516
              thd->variables.*offset);
1517
 
  return (uchar*) enum_names->type_names[tmp];
 
1517
  return (unsigned char*) enum_names->type_names[tmp];
1518
1518
}
1519
1519
 
1520
1520
bool sys_var_thd_bit::check(THD *thd, set_var *var)
1530
1530
}
1531
1531
 
1532
1532
 
1533
 
uchar *sys_var_thd_bit::value_ptr(THD *thd,
 
1533
unsigned char *sys_var_thd_bit::value_ptr(THD *thd,
1534
1534
                                  enum_var_type type __attribute__((unused)),
1535
1535
                                  LEX_STRING *base __attribute__((unused)))
1536
1536
{
1540
1540
  */
1541
1541
  thd->sys_var_tmp.bool_value= ((thd->options & bit_flag) ?
1542
1542
                                   !reverse : reverse);
1543
 
  return (uchar*) &thd->sys_var_tmp.bool_value;
 
1543
  return (unsigned char*) &thd->sys_var_tmp.bool_value;
1544
1544
}
1545
1545
 
1546
1546
 
1628
1628
}
1629
1629
 
1630
1630
 
1631
 
uchar *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
 
1631
unsigned char *sys_var_thd_date_time_format::value_ptr(THD *thd, enum_var_type type,
1632
1632
                                               LEX_STRING *base __attribute__((unused)))
1633
1633
{
1634
1634
  if (type == OPT_GLOBAL)
1641
1641
    */
1642
1642
    res= thd->strmake((global_system_variables.*offset)->format.str,
1643
1643
                      (global_system_variables.*offset)->format.length);
1644
 
    return (uchar*) res;
 
1644
    return (unsigned char*) res;
1645
1645
  }
1646
 
  return (uchar*) (thd->variables.*offset)->format.str;
 
1646
  return (unsigned char*) (thd->variables.*offset)->format.str;
1647
1647
}
1648
1648
 
1649
1649
 
1735
1735
}
1736
1736
 
1737
1737
 
1738
 
uchar *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
 
1738
unsigned char *sys_var_character_set::value_ptr(THD *thd, enum_var_type type,
1739
1739
                                        LEX_STRING *base __attribute__((unused)))
1740
1740
{
1741
1741
  const CHARSET_INFO * const cs= ci_ptr(thd,type)[0];
1742
 
  return cs ? (uchar*) cs->csname : (uchar*) NULL;
 
1742
  return cs ? (unsigned char*) cs->csname : (unsigned char*) NULL;
1743
1743
}
1744
1744
 
1745
1745
 
1824
1824
}
1825
1825
 
1826
1826
 
1827
 
uchar *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
 
1827
unsigned char *sys_var_collation_sv::value_ptr(THD *thd, enum_var_type type,
1828
1828
                                       LEX_STRING *base __attribute__((unused)))
1829
1829
{
1830
1830
  const CHARSET_INFO *cs= ((type == OPT_GLOBAL) ?
1831
1831
                     global_system_variables.*offset : thd->variables.*offset);
1832
 
  return cs ? (uchar*) cs->name : (uchar*) "NULL";
 
1832
  return cs ? (unsigned char*) cs->name : (unsigned char*) "NULL";
1833
1833
}
1834
1834
 
1835
1835
 
1847
1847
}
1848
1848
 
1849
1849
 
1850
 
uchar *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((unused)),
 
1850
unsigned char *sys_var_key_cache_param::value_ptr(THD *thd __attribute__((unused)),
1851
1851
                                          enum_var_type type __attribute__((unused)),
1852
1852
                                          LEX_STRING *base __attribute__((unused)))
1853
1853
{
1854
1854
  KEY_CACHE *key_cache= get_key_cache(base);
1855
1855
  if (!key_cache)
1856
1856
    key_cache= &zero_key_cache;
1857
 
  return (uchar*) key_cache + offset ;
 
1857
  return (unsigned char*) key_cache + offset ;
1858
1858
}
1859
1859
 
1860
1860
 
2090
2090
}
2091
2091
 
2092
2092
 
2093
 
uchar *sys_var_log_output::value_ptr(THD *thd,
 
2093
unsigned char *sys_var_log_output::value_ptr(THD *thd,
2094
2094
                                     enum_var_type type __attribute__((unused)),
2095
2095
                                     LEX_STRING *base __attribute__((unused)))
2096
2096
{
2112
2112
 
2113
2113
  if ((length= tmp.length()))
2114
2114
    length--;
2115
 
  return (uchar*) thd->strmake(tmp.ptr(), length);
 
2115
  return (unsigned char*) thd->strmake(tmp.ptr(), length);
2116
2116
}
2117
2117
 
2118
2118
 
2158
2158
}
2159
2159
 
2160
2160
 
2161
 
uchar *sys_var_timestamp::value_ptr(THD *thd,
 
2161
unsigned char *sys_var_timestamp::value_ptr(THD *thd,
2162
2162
                                    enum_var_type type __attribute__((unused)),
2163
2163
                                    LEX_STRING *base __attribute__((unused)))
2164
2164
{
2165
2165
  thd->sys_var_tmp.long_value= (long) thd->start_time;
2166
 
  return (uchar*) &thd->sys_var_tmp.long_value;
 
2166
  return (unsigned char*) &thd->sys_var_tmp.long_value;
2167
2167
}
2168
2168
 
2169
2169
 
2175
2175
}
2176
2176
 
2177
2177
 
2178
 
uchar *sys_var_last_insert_id::value_ptr(THD *thd,
 
2178
unsigned char *sys_var_last_insert_id::value_ptr(THD *thd,
2179
2179
                                         enum_var_type type __attribute__((unused)),
2180
2180
                                         LEX_STRING *base __attribute__((unused)))
2181
2181
{
2185
2185
  */
2186
2186
  thd->sys_var_tmp.uint64_t_value= 
2187
2187
    thd->read_first_successful_insert_id_in_prev_stmt();
2188
 
  return (uchar*) &thd->sys_var_tmp.uint64_t_value;
 
2188
  return (unsigned char*) &thd->sys_var_tmp.uint64_t_value;
2189
2189
}
2190
2190
 
2191
2191
 
2196
2196
}
2197
2197
 
2198
2198
 
2199
 
uchar *sys_var_insert_id::value_ptr(THD *thd,
 
2199
unsigned char *sys_var_insert_id::value_ptr(THD *thd,
2200
2200
                                    enum_var_type type __attribute__((unused)),
2201
2201
                                    LEX_STRING *base __attribute__((unused)))
2202
2202
{
2203
2203
  thd->sys_var_tmp.uint64_t_value=
2204
2204
    thd->auto_inc_intervals_forced.minimum();
2205
 
  return (uchar*) &thd->sys_var_tmp.uint64_t_value;
 
2205
  return (unsigned char*) &thd->sys_var_tmp.uint64_t_value;
2206
2206
}
2207
2207
 
2208
2208
 
2249
2249
}
2250
2250
 
2251
2251
 
2252
 
uchar *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
 
2252
unsigned char *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type,
2253
2253
                                        LEX_STRING *base __attribute__((unused)))
2254
2254
{
2255
2255
  /* 
2257
2257
    time zone name is guaranteed to be zero ended.
2258
2258
  */
2259
2259
  if (type == OPT_GLOBAL)
2260
 
    return (uchar *)(global_system_variables.time_zone->get_name()->ptr());
 
2260
    return (unsigned char *)(global_system_variables.time_zone->get_name()->ptr());
2261
2261
  else
2262
2262
  {
2263
2263
    /*
2269
2269
      (binlog code stores session value only).
2270
2270
    */
2271
2271
    thd->time_zone_used= 1;
2272
 
    return (uchar *)(thd->variables.time_zone->get_name()->ptr());
 
2272
    return (unsigned char *)(thd->variables.time_zone->get_name()->ptr());
2273
2273
  }
2274
2274
}
2275
2275
 
2333
2333
}
2334
2334
 
2335
2335
 
2336
 
uchar *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
 
2336
unsigned char *sys_var_max_user_conn::value_ptr(THD *thd, enum_var_type type,
2337
2337
                                        LEX_STRING *base __attribute__((unused)))
2338
2338
{
2339
2339
  if (type != OPT_GLOBAL &&
2340
2340
      thd->user_connect && thd->user_connect->user_resources.user_conn)
2341
 
    return (uchar*) &(thd->user_connect->user_resources.user_conn);
2342
 
  return (uchar*) &(max_user_connections);
 
2341
    return (unsigned char*) &(thd->user_connect->user_resources.user_conn);
 
2342
  return (unsigned char*) &(max_user_connections);
2343
2343
}
2344
2344
 
2345
2345
 
2391
2391
}
2392
2392
 
2393
2393
 
2394
 
uchar *sys_var_thd_lc_time_names::value_ptr(THD *thd,
 
2394
unsigned char *sys_var_thd_lc_time_names::value_ptr(THD *thd,
2395
2395
                                            enum_var_type type,
2396
2396
                                            LEX_STRING *base __attribute__((unused)))
2397
2397
{
2398
2398
  return type == OPT_GLOBAL ?
2399
 
                 (uchar *) global_system_variables.lc_time_names->name :
2400
 
                 (uchar *) thd->variables.lc_time_names->name;
 
2399
                 (unsigned char *) global_system_variables.lc_time_names->name :
 
2400
                 (unsigned char *) thd->variables.lc_time_names->name;
2401
2401
}
2402
2402
 
2403
2403
 
2453
2453
}
2454
2454
 
2455
2455
 
2456
 
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
 
2456
unsigned char *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
2457
2457
                                          LEX_STRING *base __attribute__((unused)))
2458
2458
{
2459
2459
  thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
2460
2460
                                   global_system_variables.*offset :
2461
2461
                                   thd->variables.*offset) / 1000000.0;
2462
 
  return (uchar*) &thd->tmp_double_value;
 
2462
  return (unsigned char*) &thd->tmp_double_value;
2463
2463
}
2464
2464
 
2465
2465
 
2523
2523
  return 0;
2524
2524
}
2525
2525
 
2526
 
static uchar *get_warning_count(THD *thd)
 
2526
static unsigned char *get_warning_count(THD *thd)
2527
2527
{
2528
2528
  thd->sys_var_tmp.long_value=
2529
2529
    (thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_NOTE] +
2530
2530
     thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_ERROR] +
2531
2531
     thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_WARN]);
2532
 
  return (uchar*) &thd->sys_var_tmp.long_value;
 
2532
  return (unsigned char*) &thd->sys_var_tmp.long_value;
2533
2533
}
2534
2534
 
2535
 
static uchar *get_error_count(THD *thd)
 
2535
static unsigned char *get_error_count(THD *thd)
2536
2536
{
2537
2537
  thd->sys_var_tmp.long_value= 
2538
2538
    thd->warn_count[(uint) DRIZZLE_ERROR::WARN_LEVEL_ERROR];
2539
 
  return (uchar*) &thd->sys_var_tmp.long_value;
 
2539
  return (unsigned char*) &thd->sys_var_tmp.long_value;
2540
2540
}
2541
2541
 
2542
2542
 
2554
2554
  @retval
2555
2555
    ptr         pointer to NUL-terminated string
2556
2556
*/
2557
 
static uchar *get_tmpdir(THD *thd __attribute__((unused)))
 
2557
static unsigned char *get_tmpdir(THD *thd __attribute__((unused)))
2558
2558
{
2559
2559
  if (opt_mysql_tmpdir)
2560
 
    return (uchar *)opt_mysql_tmpdir;
2561
 
  return (uchar*)mysql_tmpdir;
 
2560
    return (unsigned char *)opt_mysql_tmpdir;
 
2561
  return (unsigned char*)mysql_tmpdir;
2562
2562
}
2563
2563
 
2564
2564
/****************************************************************************
2604
2604
  Return variable name and length for hashing of variables.
2605
2605
*/
2606
2606
 
2607
 
static uchar *get_sys_var_length(const sys_var *var, size_t *length,
 
2607
static unsigned char *get_sys_var_length(const sys_var *var, size_t *length,
2608
2608
                                 bool first __attribute__((unused)))
2609
2609
{
2610
2610
  *length= var->name_length;
2611
 
  return (uchar*) var->name;
 
2611
  return (unsigned char*) var->name;
2612
2612
}
2613
2613
 
2614
2614
 
2636
2636
  {
2637
2637
    var->name_length= strlen(var->name);
2638
2638
    /* this fails if there is a conflicting variable name. see HASH_UNIQUE */
2639
 
    if (my_hash_insert(&system_variable_hash, (uchar*) var))
 
2639
    if (my_hash_insert(&system_variable_hash, (unsigned char*) var))
2640
2640
      goto error;
2641
2641
    if (long_options)
2642
2642
      var->option_limits= find_option(long_options, var->name);
2645
2645
 
2646
2646
error:
2647
2647
  for (; first != var; first= first->next)
2648
 
    hash_delete(&system_variable_hash, (uchar*) first);
 
2648
    hash_delete(&system_variable_hash, (unsigned char*) first);
2649
2649
  return 1;
2650
2650
}
2651
2651
 
2669
2669
  /* A write lock should be held on LOCK_system_variables_hash */
2670
2670
   
2671
2671
  for (sys_var *var= first; var; var= var->next)
2672
 
    result|= hash_delete(&system_variable_hash, (uchar*) var);
 
2672
    result|= hash_delete(&system_variable_hash, (unsigned char*) var);
2673
2673
 
2674
2674
  return result;
2675
2675
}
2789
2789
int mysql_append_static_vars(const SHOW_VAR *show_vars, uint count)
2790
2790
{
2791
2791
  for (; count > 0; count--, show_vars++)
2792
 
    if (insert_dynamic(&fixed_show_vars, (uchar*) show_vars))
 
2792
    if (insert_dynamic(&fixed_show_vars, (unsigned char*) show_vars))
2793
2793
      return 1;
2794
2794
  return 0;
2795
2795
}
2818
2818
    A lock on LOCK_system_variable_hash should be held
2819
2819
  */
2820
2820
  var= (sys_var*) hash_search(&system_variable_hash,
2821
 
                              (uchar*) str, length ? length : strlen(str));
 
2821
                              (unsigned char*) str, length ? length : strlen(str));
2822
2822
  if (!(var || no_error))
2823
2823
    my_error(ER_UNKNOWN_SYSTEM_VARIABLE, MYF(0), (char*) str);
2824
2824
 
3024
3024
}
3025
3025
 
3026
3026
 
3027
 
uchar *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
 
3027
unsigned char *sys_var_thd_storage_engine::value_ptr(THD *thd, enum_var_type type,
3028
3028
                                             LEX_STRING *base __attribute__((unused)))
3029
3029
{
3030
 
  uchar* result;
 
3030
  unsigned char* result;
3031
3031
  handlerton *hton;
3032
3032
  LEX_STRING *engine_name;
3033
3033
  plugin_ref plugin= thd->variables.*offset;
3035
3035
    plugin= my_plugin_lock(thd, &(global_system_variables.*offset));
3036
3036
  hton= plugin_data(plugin, handlerton*);
3037
3037
  engine_name= &hton2plugin[hton->slot]->name;
3038
 
  result= (uchar *) thd->strmake(engine_name->str, engine_name->length);
 
3038
  result= (unsigned char *) thd->strmake(engine_name->str, engine_name->length);
3039
3039
  if (type == OPT_GLOBAL)
3040
3040
    plugin_unlock(thd, plugin);
3041
3041
  return result;
3106
3106
}
3107
3107
 
3108
3108
 
3109
 
uchar *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
 
3109
unsigned char *sys_var_thd_optimizer_switch::value_ptr(THD *thd, enum_var_type type,
3110
3110
                                               LEX_STRING *base __attribute__((unused)))
3111
3111
{
3112
3112
  LEX_STRING opts;
3113
3113
  uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
3114
3114
                  thd->variables.*offset);
3115
3115
  (void) symbolic_mode_representation(thd, val, &opts);
3116
 
  return (uchar *) opts.str;
 
3116
  return (unsigned char *) opts.str;
3117
3117
}
3118
3118
 
3119
3119
 
3130
3130
  Named list handling
3131
3131
****************************************************************************/
3132
3132
 
3133
 
uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
 
3133
unsigned char* find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
3134
3134
                NAMED_LIST **found)
3135
3135
{
3136
3136
  I_List_iterator<NAMED_LIST> it(*list);
3149
3149
 
3150
3150
 
3151
3151
void delete_elements(I_List<NAMED_LIST> *list,
3152
 
                     void (*free_element)(const char *name, uchar*))
 
3152
                     void (*free_element)(const char *name, unsigned char*))
3153
3153
{
3154
3154
  NAMED_LIST *element;
3155
3155
  while ((element= list->get()))
3170
3170
  if ((key_cache= (KEY_CACHE*) my_malloc(sizeof(KEY_CACHE),
3171
3171
                                             MYF(MY_ZEROFILL | MY_WME))))
3172
3172
  {
3173
 
    if (!new NAMED_LIST(&key_caches, name, length, (uchar*) key_cache))
 
3173
    if (!new NAMED_LIST(&key_caches, name, length, (unsigned char*) key_cache))
3174
3174
    {
3175
3175
      free((char*) key_cache);
3176
3176
      key_cache= 0;