~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Brian Aker
  • Date: 2008-11-24 06:52:21 UTC
  • Revision ID: brian@tangent.org-20081124065221-tps3gwixhe53i4gn
Remove useless global variable (let plugins decide)

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
                                               fix_max_relay_log_size);
244
244
static sys_var_session_ulong    sys_max_sort_length(&vars, "max_sort_length",
245
245
                                            &SV::max_sort_length);
246
 
static sys_var_max_user_conn   sys_max_user_connections(&vars, "max_user_connections");
247
246
static sys_var_session_ulong    sys_max_tmp_tables(&vars, "max_tmp_tables",
248
247
                                           &SV::max_tmp_tables);
249
248
static sys_var_long_ptr sys_max_write_lock_count(&vars, "max_write_lock_count",
2160
2159
}
2161
2160
 
2162
2161
 
2163
 
bool sys_var_max_user_conn::check(Session *session, set_var *var)
2164
 
{
2165
 
  if (var->type == OPT_GLOBAL)
2166
 
    return sys_var_session::check(session, var);
2167
 
  else
2168
 
  {
2169
 
    /*
2170
 
      Per-session values of max_user_connections can't be set directly.
2171
 
      May be we should have a separate error message for this?
2172
 
    */
2173
 
    my_error(ER_GLOBAL_VARIABLE, MYF(0), name);
2174
 
    return true;
2175
 
  }
2176
 
}
2177
 
 
2178
 
bool sys_var_max_user_conn::update(Session *, set_var *var)
2179
 
{
2180
 
  assert(var->type == OPT_GLOBAL);
2181
 
  pthread_mutex_lock(&LOCK_global_system_variables);
2182
 
  max_user_connections= (uint)var->save_result.uint64_t_value;
2183
 
  pthread_mutex_unlock(&LOCK_global_system_variables);
2184
 
  return 0;
2185
 
}
2186
 
 
2187
 
 
2188
 
void sys_var_max_user_conn::set_default(Session *, enum_var_type type)
2189
 
{
2190
 
  assert(type == OPT_GLOBAL);
2191
 
  pthread_mutex_lock(&LOCK_global_system_variables);
2192
 
  max_user_connections= (ulong) option_limits->def_value;
2193
 
  pthread_mutex_unlock(&LOCK_global_system_variables);
2194
 
}
2195
 
 
2196
 
 
2197
 
unsigned char *sys_var_max_user_conn::value_ptr(Session *session,
2198
 
                                                enum_var_type type,
2199
 
                                                LEX_STRING *)
2200
 
{
2201
 
  if (type != OPT_GLOBAL &&
2202
 
      session->user_connect && session->user_connect->user_resources.user_conn)
2203
 
    return (unsigned char*) &(session->user_connect->user_resources.user_conn);
2204
 
  return (unsigned char*) &(max_user_connections);
2205
 
}
2206
 
 
2207
 
 
2208
2162
bool sys_var_session_lc_time_names::check(Session *, set_var *var)
2209
2163
{
2210
2164
  MY_LOCALE *locale_match;