~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/kill.cc

  • Committer: Lee Bieber
  • Date: 2010-12-23 23:11:00 UTC
  • mfrom: (2024.1.1 clean)
  • Revision ID: kalebral@gmail.com-20101223231100-0rqirgz7ugkl10yp
Merge Brian - session list cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
namespace drizzled
28
28
{
29
29
 
30
 
static bool kill_one_thread(session_id_t id, bool only_kill_query)
 
30
bool statement::Kill::kill(session_id_t id, bool only_kill_query)
31
31
{
32
 
  drizzled::Session::shared_ptr session= session::Cache::singleton().find(id);
 
32
  drizzled::Session::shared_ptr session_param= session::Cache::singleton().find(id);
33
33
 
34
 
  if (session and session->isViewable())
 
34
  if (session_param and session_param->isViewable(*getSession()->user()))
35
35
  {
36
 
    session->awake(only_kill_query ? Session::KILL_QUERY : Session::KILL_CONNECTION);
 
36
    session_param->awake(only_kill_query ? Session::KILL_QUERY : Session::KILL_CONNECTION);
37
37
    return true;
38
38
  }
39
39
 
52
52
    return true;
53
53
  }
54
54
 
55
 
  if (kill_one_thread(static_cast<session_id_t>(it->val_int()), session->lex->type & ONLY_KILL_QUERY))
 
55
  if (kill(static_cast<session_id_t>(it->val_int()), session->lex->type & ONLY_KILL_QUERY))
56
56
  {
57
57
    session->my_ok();
58
58
  }