~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/set_var.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
  @note
44
44
    Be careful with var->save_result: sys_var::check() only updates
45
 
    ulonglong_value; so other members of the union are garbage then; to use
 
45
    uint64_t_value; so other members of the union are garbage then; to use
46
46
    them you must first assign a value to them (in specific ::check() for
47
47
    example).
48
48
*/
113
113
static void fix_thd_mem_root(THD *thd, enum_var_type type);
114
114
static void fix_trans_mem_root(THD *thd, enum_var_type type);
115
115
static void fix_server_id(THD *thd, enum_var_type type);
116
 
static ulonglong fix_unsigned(THD *, ulonglong, const struct my_option *);
 
116
static uint64_t fix_unsigned(THD *, uint64_t, const struct my_option *);
117
117
static bool get_unsigned(THD *thd, set_var *var);
118
118
bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
119
 
                          const char *name, longlong val);
 
119
                          const char *name, int64_t val);
120
120
static KEY_CACHE *create_key_cache(const char *name, uint length);
121
121
static uchar *get_error_count(THD *thd);
122
122
static uchar *get_warning_count(THD *thd);
260
260
                                               &max_connect_errors);
261
261
static sys_var_thd_ulong        sys_max_error_count(&vars, "max_error_count",
262
262
                                            &SV::max_error_count);
263
 
static sys_var_thd_ulonglong    sys_max_heap_table_size(&vars, "max_heap_table_size",
 
263
static sys_var_thd_uint64_t     sys_max_heap_table_size(&vars, "max_heap_table_size",
264
264
                                                &SV::max_heap_table_size);
265
265
static sys_var_thd_ulong sys_pseudo_thread_id(&vars, "pseudo_thread_id",
266
266
                                              &SV::pseudo_thread_id,
292
292
                                                          &SV::min_examined_row_limit);
293
293
static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size",
294
294
                                                    &myisam_data_pointer_size);
295
 
static sys_var_thd_ulonglong    sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
 
295
static sys_var_thd_uint64_t     sys_myisam_max_sort_file_size(&vars, "myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
296
296
static sys_var_thd_ulong       sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
297
297
static sys_var_thd_ulong        sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
298
298
 
414
414
                                         &tx_isolation_typelib,
415
415
                                         fix_tx_isolation,
416
416
                                         check_tx_isolation);
417
 
static sys_var_thd_ulonglong    sys_tmp_table_size(&vars, "tmp_table_size",
 
417
static sys_var_thd_uint64_t     sys_tmp_table_size(&vars, "tmp_table_size",
418
418
                                           &SV::tmp_table_size);
419
 
static sys_var_bool_ptr  sys_timed_mutexes(&vars, "timed_mutexes",
420
 
                                    &timed_mutexes);
 
419
static sys_var_bool_ptr  sys_timed_mutexes(&vars, "timed_mutexes", &timed_mutexes);
421
420
static sys_var_const_str        sys_version(&vars, "version", server_version);
422
421
static sys_var_const_str        sys_version_comment(&vars, "version_comment",
423
422
                                            MYSQL_COMPILATION_COMMENT);
595
594
static sys_var_log_state sys_var_general_log(&vars, "general_log", &opt_log,
596
595
                                      QUERY_LOG_GENERAL);
597
596
/* Synonym of "general_log" for consistency with SHOW VARIABLES output */
598
 
static sys_var_log_state sys_var_log(&vars, "log", &opt_log,
599
 
                                      QUERY_LOG_GENERAL);
 
597
static sys_var_log_state sys_var_log(&vars, "log", &opt_log, QUERY_LOG_GENERAL);
600
598
static sys_var_log_state sys_var_slow_query_log(&vars, "slow_query_log", &opt_slow_log,
601
599
                                         QUERY_LOG_SLOW);
602
600
/* Synonym of "slow_query_log" for consistency with SHOW VARIABLES output */
649
647
 
650
648
bool sys_var::check(THD *thd __attribute__((__unused__)), set_var *var)
651
649
{
652
 
  var->save_result.ulonglong_value= var->value->val_int();
 
650
  var->save_result.uint64_t_value= var->value->val_int();
653
651
  return 0;
654
652
}
655
653
 
800
798
static int check_completion_type(THD *thd __attribute__((__unused__)),
801
799
                                 set_var *var)
802
800
{
803
 
  longlong val= var->value->val_int();
 
801
  int64_t val= var->value->val_int();
804
802
  if (val < 0 || val > 2)
805
803
  {
806
804
    char buf[64];
1035
1033
 
1036
1034
 
1037
1035
bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
1038
 
                          const char *name, longlong val)
 
1036
                          const char *name, int64_t val)
1039
1037
{
1040
1038
  if (fixed)
1041
1039
  {
1042
1040
    char buf[22];
1043
1041
 
1044
1042
    if (unsignd)
1045
 
      ullstr((ulonglong) val, buf);
 
1043
      ullstr((uint64_t) val, buf);
1046
1044
    else
1047
1045
      llstr(val, buf);
1048
1046
 
1053
1051
  return false;
1054
1052
}
1055
1053
 
1056
 
static ulonglong fix_unsigned(THD *thd, ulonglong num,
 
1054
static uint64_t fix_unsigned(THD *thd, uint64_t num,
1057
1055
                              const struct my_option *option_limits)
1058
1056
{
1059
1057
  bool fixed= false;
1060
 
  ulonglong out= getopt_ull_limit_value(num, option_limits, &fixed);
 
1058
  uint64_t out= getopt_ull_limit_value(num, option_limits, &fixed);
1061
1059
 
1062
 
  throw_bounds_warning(thd, fixed, true, option_limits->name, (longlong) num);
 
1060
  throw_bounds_warning(thd, fixed, true, option_limits->name, (int64_t) num);
1063
1061
  return out;
1064
1062
}
1065
1063
 
1066
1064
static bool get_unsigned(THD *thd __attribute__((__unused__)), set_var *var)
1067
1065
{
1068
1066
  if (var->value->unsigned_flag)
1069
 
    var->save_result.ulonglong_value= (ulonglong) var->value->val_int();
 
1067
    var->save_result.uint64_t_value= (uint64_t) var->value->val_int();
1070
1068
  else
1071
1069
  {
1072
 
    longlong v= var->value->val_int();
1073
 
    var->save_result.ulonglong_value= (ulonglong) ((v < 0) ? 0 : v);
 
1070
    int64_t v= var->value->val_int();
 
1071
    var->save_result.uint64_t_value= (uint64_t) ((v < 0) ? 0 : v);
1074
1072
  }
1075
1073
  return 0;
1076
1074
}
1091
1089
 
1092
1090
bool sys_var_long_ptr_global::update(THD *thd, set_var *var)
1093
1091
{
1094
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1092
  uint64_t tmp= var->save_result.uint64_t_value;
1095
1093
  pthread_mutex_lock(guard);
1096
1094
  if (option_limits)
1097
1095
    *value= (ulong) fix_unsigned(thd, tmp, option_limits);
1103
1101
    {
1104
1102
      tmp= ULONG_MAX;
1105
1103
      throw_bounds_warning(thd, true, true, name,
1106
 
                           (longlong) var->save_result.ulonglong_value);
 
1104
                           (int64_t) var->save_result.uint64_t_value);
1107
1105
    }
1108
1106
#endif
1109
1107
    *value= (ulong) tmp;
1124
1122
}
1125
1123
 
1126
1124
 
1127
 
bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var)
 
1125
bool sys_var_uint64_t_ptr::update(THD *thd, set_var *var)
1128
1126
{
1129
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1127
  uint64_t tmp= var->save_result.uint64_t_value;
1130
1128
  pthread_mutex_lock(&LOCK_global_system_variables);
1131
1129
  if (option_limits)
1132
 
    *value= (ulonglong) fix_unsigned(thd, tmp, option_limits);
 
1130
    *value= (uint64_t) fix_unsigned(thd, tmp, option_limits);
1133
1131
  else
1134
 
    *value= (ulonglong) tmp;
 
1132
    *value= (uint64_t) tmp;
1135
1133
  pthread_mutex_unlock(&LOCK_global_system_variables);
1136
1134
  return 0;
1137
1135
}
1138
1136
 
1139
1137
 
1140
 
void sys_var_ulonglong_ptr::set_default(THD *thd __attribute__((__unused__)),
 
1138
void sys_var_uint64_t_ptr::set_default(THD *thd __attribute__((__unused__)),
1141
1139
                                        enum_var_type type __attribute__((__unused__)))
1142
1140
{
1143
1141
  bool not_used;
1144
1142
  pthread_mutex_lock(&LOCK_global_system_variables);
1145
 
  *value= getopt_ull_limit_value((ulonglong) option_limits->def_value,
 
1143
  *value= getopt_ull_limit_value((uint64_t) option_limits->def_value,
1146
1144
                                 option_limits, &not_used);
1147
1145
  pthread_mutex_unlock(&LOCK_global_system_variables);
1148
1146
}
1150
1148
 
1151
1149
bool sys_var_bool_ptr::update(THD *thd __attribute__((__unused__)), set_var *var)
1152
1150
{
1153
 
  *value= (my_bool) var->save_result.ulong_value;
 
1151
  *value= (bool) var->save_result.ulong_value;
1154
1152
  return 0;
1155
1153
}
1156
1154
 
1157
1155
 
1158
1156
void sys_var_bool_ptr::set_default(THD *thd __attribute__((__unused__)), enum_var_type type __attribute__((__unused__)))
1159
1157
{
1160
 
  *value= (my_bool) option_limits->def_value;
 
1158
  *value= (bool) option_limits->def_value;
1161
1159
}
1162
1160
 
1163
1161
 
1191
1189
 
1192
1190
bool sys_var_thd_ulong::update(THD *thd, set_var *var)
1193
1191
{
1194
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1192
  uint64_t tmp= var->save_result.uint64_t_value;
1195
1193
  
1196
1194
  /* Don't use bigger value than given with --maximum-variable-name=.. */
1197
1195
  if ((ulong) tmp > max_system_variables.*offset)
1198
1196
  {
1199
 
    throw_bounds_warning(thd, true, true, name, (longlong) tmp);
 
1197
    throw_bounds_warning(thd, true, true, name, (int64_t) tmp);
1200
1198
    tmp= max_system_variables.*offset;
1201
1199
  }
1202
1200
  
1206
1204
  else if (tmp > ULONG_MAX)
1207
1205
  {
1208
1206
    tmp= ULONG_MAX;
1209
 
    throw_bounds_warning(thd, true, true, name, (longlong) var->save_result.ulonglong_value);
 
1207
    throw_bounds_warning(thd, true, true, name, (int64_t) var->save_result.uint64_t_value);
1210
1208
  }
1211
1209
#endif
1212
1210
  
1245
1243
 
1246
1244
bool sys_var_thd_ha_rows::update(THD *thd, set_var *var)
1247
1245
{
1248
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1246
  uint64_t tmp= var->save_result.uint64_t_value;
1249
1247
 
1250
1248
  /* Don't use bigger value than given with --maximum-variable-name=.. */
1251
1249
  if ((ha_rows) tmp > max_system_variables.*offset)
1291
1289
  return (uchar*) &(thd->variables.*offset);
1292
1290
}
1293
1291
 
1294
 
bool sys_var_thd_ulonglong::check(THD *thd, set_var *var)
 
1292
bool sys_var_thd_uint64_t::check(THD *thd, set_var *var)
1295
1293
{
1296
1294
  return get_unsigned(thd, var);
1297
1295
}
1298
1296
 
1299
 
bool sys_var_thd_ulonglong::update(THD *thd,  set_var *var)
 
1297
bool sys_var_thd_uint64_t::update(THD *thd,  set_var *var)
1300
1298
{
1301
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1299
  uint64_t tmp= var->save_result.uint64_t_value;
1302
1300
 
1303
1301
  if (tmp > max_system_variables.*offset)
1304
1302
    tmp= max_system_variables.*offset;
1309
1307
  {
1310
1308
    /* Lock is needed to make things safe on 32 bit systems */
1311
1309
    pthread_mutex_lock(&LOCK_global_system_variables);
1312
 
    global_system_variables.*offset= (ulonglong) tmp;
 
1310
    global_system_variables.*offset= (uint64_t) tmp;
1313
1311
    pthread_mutex_unlock(&LOCK_global_system_variables);
1314
1312
  }
1315
1313
  else
1316
 
    thd->variables.*offset= (ulonglong) tmp;
 
1314
    thd->variables.*offset= (uint64_t) tmp;
1317
1315
  return 0;
1318
1316
}
1319
1317
 
1320
1318
 
1321
 
void sys_var_thd_ulonglong::set_default(THD *thd, enum_var_type type)
 
1319
void sys_var_thd_uint64_t::set_default(THD *thd, enum_var_type type)
1322
1320
{
1323
1321
  if (type == OPT_GLOBAL)
1324
1322
  {
1325
1323
    bool not_used;
1326
1324
    pthread_mutex_lock(&LOCK_global_system_variables);
1327
1325
    global_system_variables.*offset=
1328
 
      getopt_ull_limit_value((ulonglong) option_limits->def_value,
 
1326
      getopt_ull_limit_value((uint64_t) option_limits->def_value,
1329
1327
                             option_limits, &not_used);
1330
1328
    pthread_mutex_unlock(&LOCK_global_system_variables);
1331
1329
  }
1334
1332
}
1335
1333
 
1336
1334
 
1337
 
uchar *sys_var_thd_ulonglong::value_ptr(THD *thd, enum_var_type type,
 
1335
uchar *sys_var_thd_uint64_t::value_ptr(THD *thd, enum_var_type type,
1338
1336
                                        LEX_STRING *base __attribute__((__unused__)))
1339
1337
{
1340
1338
  if (type == OPT_GLOBAL)
1391
1389
  }
1392
1390
  else
1393
1391
  {
1394
 
    ulonglong tmp=var->value->val_int();
 
1392
    uint64_t tmp=var->value->val_int();
1395
1393
    if (tmp >= enum_names->count)
1396
1394
    {
1397
1395
      llstr(tmp,buff);
1445
1443
  }
1446
1444
  else
1447
1445
  {
1448
 
    ulonglong tmp= var->value->val_int();
 
1446
    uint64_t tmp= var->value->val_int();
1449
1447
 
1450
1448
    if (!m_allow_empty_value &&
1451
1449
        tmp == 0)
1503
1501
    pthread_mutex_lock(&LOCK_global_system_variables);
1504
1502
    value= *(uint*) value_ptr(thd, var_type, base);
1505
1503
    pthread_mutex_unlock(&LOCK_global_system_variables);
1506
 
    return new Item_uint((ulonglong) value);
 
1504
    return new Item_uint((uint64_t) value);
1507
1505
  }
1508
1506
  case SHOW_LONG:
1509
1507
  {
1511
1509
    pthread_mutex_lock(&LOCK_global_system_variables);
1512
1510
    value= *(ulong*) value_ptr(thd, var_type, base);
1513
1511
    pthread_mutex_unlock(&LOCK_global_system_variables);
1514
 
    return new Item_uint((ulonglong) value);
 
1512
    return new Item_uint((uint64_t) value);
1515
1513
  }
1516
1514
  case SHOW_LONGLONG:
1517
1515
  {
1518
 
    longlong value;
 
1516
    int64_t value;
1519
1517
    pthread_mutex_lock(&LOCK_global_system_variables);
1520
 
    value= *(longlong*) value_ptr(thd, var_type, base);
 
1518
    value= *(int64_t*) value_ptr(thd, var_type, base);
1521
1519
    pthread_mutex_unlock(&LOCK_global_system_variables);
1522
1520
    return new Item_int(value);
1523
1521
  }
1536
1534
    pthread_mutex_lock(&LOCK_global_system_variables);
1537
1535
    value= *(ha_rows*) value_ptr(thd, var_type, base);
1538
1536
    pthread_mutex_unlock(&LOCK_global_system_variables);
1539
 
    return new Item_int((ulonglong) value);
 
1537
    return new Item_int((uint64_t) value);
1540
1538
  }
1541
1539
  case SHOW_MY_BOOL:
1542
1540
  {
1988
1986
 
1989
1987
bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
1990
1988
{
1991
 
  ulonglong tmp= var->save_result.ulonglong_value;
 
1989
  uint64_t tmp= var->save_result.uint64_t_value;
1992
1990
  LEX_STRING *base_name= &var->base;
1993
1991
  KEY_CACHE *key_cache;
1994
1992
  bool error= 0;
2053
2051
  }
2054
2052
 
2055
2053
  key_cache->param_buff_size=
2056
 
    (ulonglong) fix_unsigned(thd, tmp, option_limits);
 
2054
    (uint64_t) fix_unsigned(thd, tmp, option_limits);
2057
2055
 
2058
2056
  /* If key cache didn't existed initialize it, else resize it */
2059
2057
  key_cache->in_init= 1;
2392
2390
 
2393
2391
bool sys_var_timestamp::update(THD *thd,  set_var *var)
2394
2392
{
2395
 
  thd->set_time((time_t) var->save_result.ulonglong_value);
 
2393
  thd->set_time((time_t) var->save_result.uint64_t_value);
2396
2394
  return 0;
2397
2395
}
2398
2396
 
2416
2414
bool sys_var_last_insert_id::update(THD *thd, set_var *var)
2417
2415
{
2418
2416
  thd->first_successful_insert_id_in_prev_stmt=
2419
 
    var->save_result.ulonglong_value;
 
2417
    var->save_result.uint64_t_value;
2420
2418
  return 0;
2421
2419
}
2422
2420
 
2429
2427
    this tmp var makes it robust againt change of type of
2430
2428
    read_first_successful_insert_id_in_prev_stmt().
2431
2429
  */
2432
 
  thd->sys_var_tmp.ulonglong_value= 
 
2430
  thd->sys_var_tmp.uint64_t_value= 
2433
2431
    thd->read_first_successful_insert_id_in_prev_stmt();
2434
 
  return (uchar*) &thd->sys_var_tmp.ulonglong_value;
 
2432
  return (uchar*) &thd->sys_var_tmp.uint64_t_value;
2435
2433
}
2436
2434
 
2437
2435
 
2438
2436
bool sys_var_insert_id::update(THD *thd, set_var *var)
2439
2437
{
2440
 
  thd->force_one_auto_inc_interval(var->save_result.ulonglong_value);
 
2438
  thd->force_one_auto_inc_interval(var->save_result.uint64_t_value);
2441
2439
  return 0;
2442
2440
}
2443
2441
 
2446
2444
                                    enum_var_type type __attribute__((__unused__)),
2447
2445
                                    LEX_STRING *base __attribute__((__unused__)))
2448
2446
{
2449
 
  thd->sys_var_tmp.ulonglong_value=
 
2447
  thd->sys_var_tmp.uint64_t_value=
2450
2448
    thd->auto_inc_intervals_forced.minimum();
2451
 
  return (uchar*) &thd->sys_var_tmp.ulonglong_value;
 
2449
  return (uchar*) &thd->sys_var_tmp.uint64_t_value;
2452
2450
}
2453
2451
 
2454
2452
 
2455
2453
bool sys_var_rand_seed1::update(THD *thd, set_var *var)
2456
2454
{
2457
 
  thd->rand.seed1= (ulong) var->save_result.ulonglong_value;
 
2455
  thd->rand.seed1= (ulong) var->save_result.uint64_t_value;
2458
2456
  return 0;
2459
2457
}
2460
2458
 
2461
2459
bool sys_var_rand_seed2::update(THD *thd, set_var *var)
2462
2460
{
2463
 
  thd->rand.seed2= (ulong) var->save_result.ulonglong_value;
 
2461
  thd->rand.seed2= (ulong) var->save_result.uint64_t_value;
2464
2462
  return 0;
2465
2463
}
2466
2464
 
2563
2561
{
2564
2562
  assert(var->type == OPT_GLOBAL);
2565
2563
  pthread_mutex_lock(&LOCK_global_system_variables);
2566
 
  max_user_connections= (uint)var->save_result.ulonglong_value;
 
2564
  max_user_connections= (uint)var->save_result.uint64_t_value;
2567
2565
  pthread_mutex_unlock(&LOCK_global_system_variables);
2568
2566
  return 0;
2569
2567
}
2660
2658
 
2661
2659
  NOTES
2662
2660
    The argument to long query time is in seconds in decimal
2663
 
    which is converted to ulonglong integer holding microseconds for storage.
 
2661
    which is converted to uint64_t integer holding microseconds for storage.
2664
2662
    This is used for handling long_query_time
2665
2663
*/
2666
2664
 
2667
2665
bool sys_var_microseconds::update(THD *thd, set_var *var)
2668
2666
{
2669
2667
  double num= var->value->val_real();
2670
 
  longlong microseconds;
 
2668
  int64_t microseconds;
2671
2669
  if (num > (double) option_limits->max_value)
2672
2670
    num= (double) option_limits->max_value;
2673
2671
  if (num < (double) option_limits->min_value)
2674
2672
    num= (double) option_limits->min_value;
2675
 
  microseconds= (longlong) (num * 1000000.0 + 0.5);
 
2673
  microseconds= (int64_t) (num * 1000000.0 + 0.5);
2676
2674
  if (var->type == OPT_GLOBAL)
2677
2675
  {
2678
2676
    pthread_mutex_lock(&LOCK_global_system_variables);
2687
2685
 
2688
2686
void sys_var_microseconds::set_default(THD *thd, enum_var_type type)
2689
2687
{
2690
 
  longlong microseconds= (longlong) (option_limits->def_value * 1000000.0);
 
2688
  int64_t microseconds= (int64_t) (option_limits->def_value * 1000000.0);
2691
2689
  if (type == OPT_GLOBAL)
2692
2690
  {
2693
2691
    pthread_mutex_lock(&LOCK_global_system_variables);
2728
2726
{
2729
2727
  /* The test is negative as the flag we use is NOT autocommit */
2730
2728
 
2731
 
  ulonglong org_options= thd->options;
 
2729
  uint64_t org_options= thd->options;
2732
2730
 
2733
2731
  if (var->save_result.ulong_value != 0)
2734
2732
    thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
2740
2738
    if ((org_options & OPTION_NOT_AUTOCOMMIT))
2741
2739
    {
2742
2740
      /* We changed to auto_commit mode */
2743
 
      thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG);
 
2741
      thd->options&= ~(uint64_t) (OPTION_BEGIN | OPTION_KEEP_LOG);
2744
2742
      thd->transaction.all.modified_non_trans_table= false;
2745
2743
      thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
2746
2744
      if (ha_commit(thd))
2788
2786
static int check_pseudo_thread_id(THD *thd __attribute__((__unused__)),
2789
2787
                                  set_var *var)
2790
2788
{
2791
 
  var->save_result.ulonglong_value= var->value->val_int();
 
2789
  var->save_result.uint64_t_value= var->value->val_int();
2792
2790
  return 0;
2793
2791
}
2794
2792
 
3356
3354
 
3357
3355
bool
3358
3356
sys_var_thd_optimizer_switch::
3359
 
symbolic_mode_representation(THD *thd, ulonglong val, LEX_STRING *rep)
 
3357
symbolic_mode_representation(THD *thd, uint64_t val, LEX_STRING *rep)
3360
3358
{
3361
3359
  char buff[STRING_BUFFER_USUAL_SIZE*8];
3362
3360
  String tmp(buff, sizeof(buff), &my_charset_latin1);
3388
3386
                                               LEX_STRING *base __attribute__((__unused__)))
3389
3387
{
3390
3388
  LEX_STRING opts;
3391
 
  ulonglong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
 
3389
  uint64_t val= ((type == OPT_GLOBAL) ? global_system_variables.*offset :
3392
3390
                  thd->variables.*offset);
3393
3391
  (void) symbolic_mode_representation(thd, val, &opts);
3394
3392
  return (uchar *) opts.str;