~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/drizzled.cc

  • Committer: Brian Aker
  • Date: 2008-07-09 16:23:26 UTC
  • mfrom: (77.1.47 codestyle)
  • Revision ID: brian@tangent.org-20080709162326-r1lzclu3qd8cqk6i
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1784
1784
  return(0);                                    /* purecov: deadcode */
1785
1785
}
1786
1786
 
1787
 
static void check_data_home(const char *path)
 
1787
static void check_data_home(const char *path __attribute__((__unused__)))
1788
1788
{}
1789
1789
 
1790
1790
#endif  /* __WIN__*/
4053
4053
  {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
4054
4054
};
4055
4055
 
4056
 
static int show_net_compression(THD *thd, SHOW_VAR *var, char *buff)
 
4056
static int show_net_compression(THD *thd __attribute__((__unused__)),
 
4057
                                SHOW_VAR *var,
 
4058
                                char *buff __attribute__((__unused__)))
4057
4059
{
4058
4060
  var->type= SHOW_MY_BOOL;
4059
4061
  var->value= (char *)&thd->net.compress;
4060
4062
  return 0;
4061
4063
}
4062
4064
 
 
4065
static st_show_var_func_container
 
4066
show_net_compression_cont= { &show_net_compression };
 
4067
 
4063
4068
static int show_starttime(THD *thd, SHOW_VAR *var, char *buff)
4064
4069
{
4065
4070
  var->type= SHOW_LONG;
4068
4073
  return 0;
4069
4074
}
4070
4075
 
 
4076
static st_show_var_func_container
 
4077
show_starttime_cont= { &show_starttime };
 
4078
 
4071
4079
static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff)
4072
4080
{
4073
4081
  var->type= SHOW_LONG;
4076
4084
  return 0;
4077
4085
}
4078
4086
 
4079
 
static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
 
4087
static st_show_var_func_container
 
4088
show_flushstatustime_cont= { &show_flushstatustime };
 
4089
 
 
4090
static int show_slave_running(THD *thd __attribute__((__unused__)),
 
4091
                              SHOW_VAR *var, char *buff)
4080
4092
{
4081
4093
  var->type= SHOW_MY_BOOL;
4082
4094
  pthread_mutex_lock(&LOCK_active_mi);
4087
4099
  return 0;
4088
4100
}
4089
4101
 
4090
 
static int show_slave_retried_trans(THD *thd, SHOW_VAR *var, char *buff)
 
4102
static st_show_var_func_container
 
4103
show_slave_running_cont= { &show_slave_running };
 
4104
 
 
4105
static int show_slave_retried_trans(THD *thd __attribute__((__unused__)),
 
4106
                                    SHOW_VAR *var, char *buff)
4091
4107
{
4092
4108
  /*
4093
4109
    TODO: with multimaster, have one such counter per line in
4108
4124
  return 0;
4109
4125
}
4110
4126
 
4111
 
static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff)
 
4127
static st_show_var_func_container
 
4128
show_slave_retried_trans_cont= { &show_slave_retried_trans };
 
4129
 
 
4130
static int show_slave_received_heartbeats(THD *thd __attribute__((__unused__)),
 
4131
                                          SHOW_VAR *var, char *buff)
4112
4132
{
4113
4133
  pthread_mutex_lock(&LOCK_active_mi);
4114
4134
  if (active_mi)
4125
4145
  return 0;
4126
4146
}
4127
4147
 
4128
 
static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff)
 
4148
static st_show_var_func_container
 
4149
show_slave_received_heartbeats_cont= { &show_slave_received_heartbeats };
 
4150
 
 
4151
static int show_heartbeat_period(THD *thd __attribute__((__unused__)),
 
4152
                                 SHOW_VAR *var, char *buff)
4129
4153
{
4130
4154
  pthread_mutex_lock(&LOCK_active_mi);
4131
4155
  if (active_mi)
4140
4164
  return 0;
4141
4165
}
4142
4166
 
 
4167
static st_show_var_func_container
 
4168
show_heartbeat_period_cont= { &show_heartbeat_period};
4143
4169
 
4144
 
static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff)
 
4170
static int show_open_tables(THD *thd __attribute__((__unused__)),
 
4171
                            SHOW_VAR *var, char *buff)
4145
4172
{
4146
4173
  var->type= SHOW_LONG;
4147
4174
  var->value= buff;
4149
4176
  return 0;
4150
4177
}
4151
4178
 
4152
 
static int show_table_definitions(THD *thd, SHOW_VAR *var, char *buff)
 
4179
static int show_table_definitions(THD *thd __attribute__((__unused__)),
 
4180
                                  SHOW_VAR *var, char *buff)
4153
4181
{
4154
4182
  var->type= SHOW_LONG;
4155
4183
  var->value= buff;
4157
4185
  return 0;
4158
4186
}
4159
4187
 
 
4188
static st_show_var_func_container
 
4189
show_open_tables_cont= { &show_open_tables };
 
4190
static st_show_var_func_container
 
4191
show_table_definitions_cont= { &show_table_definitions };
 
4192
 
4160
4193
/*
4161
4194
  Variables shown by SHOW STATUS in alphabetical order
4162
4195
*/
4169
4202
  {"Bytes_received",           (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
4170
4203
  {"Bytes_sent",               (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
4171
4204
  {"Com",                      (char*) com_status_vars, SHOW_ARRAY},
4172
 
  {"Compression",              (char*) &show_net_compression, SHOW_FUNC},
 
4205
  {"Compression",              (char*) &show_net_compression_cont, SHOW_FUNC},
4173
4206
  {"Connections",              (char*) &thread_id,              SHOW_LONG_NOFLUSH},
4174
4207
  {"Created_tmp_disk_tables",  (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS},
4175
4208
  {"Created_tmp_files",        (char*) &my_tmp_file_created,    SHOW_LONG},
4201
4234
  {"Max_used_connections",     (char*) &max_used_connections,  SHOW_LONG},
4202
4235
  {"Open_files",               (char*) &my_file_opened,         SHOW_LONG_NOFLUSH},
4203
4236
  {"Open_streams",             (char*) &my_stream_opened,       SHOW_LONG_NOFLUSH},
4204
 
  {"Open_table_definitions",   (char*) &show_table_definitions, SHOW_FUNC},
4205
 
  {"Open_tables",              (char*) &show_open_tables,       SHOW_FUNC},
 
4237
  {"Open_table_definitions",   (char*) &show_table_definitions_cont, SHOW_FUNC},
 
4238
  {"Open_tables",              (char*) &show_open_tables_cont,       SHOW_FUNC},
4206
4239
  {"Opened_files",             (char*) &my_file_total_opened, SHOW_LONG_NOFLUSH},
4207
4240
  {"Opened_tables",            (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
4208
4241
  {"Opened_table_definitions", (char*) offsetof(STATUS_VAR, opened_shares), SHOW_LONG_STATUS},
4213
4246
  {"Select_range_check",       (char*) offsetof(STATUS_VAR, select_range_check_count), SHOW_LONG_STATUS},
4214
4247
  {"Select_scan",              (char*) offsetof(STATUS_VAR, select_scan_count), SHOW_LONG_STATUS},
4215
4248
  {"Slave_open_temp_tables",   (char*) &slave_open_temp_tables, SHOW_LONG},
4216
 
  {"Slave_retried_transactions",(char*) &show_slave_retried_trans, SHOW_FUNC},
4217
 
  {"Slave_heartbeat_period",   (char*) &show_heartbeat_period, SHOW_FUNC},
4218
 
  {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_FUNC},
4219
 
  {"Slave_running",            (char*) &show_slave_running,     SHOW_FUNC},
 
4249
  {"Slave_retried_transactions",(char*) &show_slave_retried_trans_cont, SHOW_FUNC},
 
4250
  {"Slave_heartbeat_period",   (char*) &show_heartbeat_period_cont, SHOW_FUNC},
 
4251
  {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats_cont, SHOW_FUNC},
 
4252
  {"Slave_running",            (char*) &show_slave_running_cont,     SHOW_FUNC},
4220
4253
  {"Slow_launch_threads",      (char*) &slow_launch_threads,    SHOW_LONG},
4221
4254
  {"Slow_queries",             (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
4222
4255
  {"Sort_merge_passes",        (char*) offsetof(STATUS_VAR, filesort_merge_passes), SHOW_LONG_STATUS},
4234
4267
  {"Threads_connected",        (char*) &connection_count,       SHOW_INT},
4235
4268
  {"Threads_created",          (char*) &thread_created,         SHOW_LONG_NOFLUSH},
4236
4269
  {"Threads_running",          (char*) &thread_running,         SHOW_INT},
4237
 
  {"Uptime",                   (char*) &show_starttime,         SHOW_FUNC},
4238
 
  {"Uptime_since_flush_status",(char*) &show_flushstatustime,   SHOW_FUNC},
 
4270
  {"Uptime",                   (char*) &show_starttime_cont,         SHOW_FUNC},
 
4271
  {"Uptime_since_flush_status",(char*) &show_flushstatustime_cont,   SHOW_FUNC},
4239
4272
  {NullS, NullS, SHOW_LONG}
4240
4273
};
4241
4274