~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/kill.cc

  • Committer: Lee Bieber
  • Date: 2011-02-24 03:20:47 UTC
  • mfrom: (2196.1.4 build)
  • Revision ID: kalebral@gmail.com-20110224032047-avmw06iwww3m73cw
Merge Andrew - 723653: Docs day first pass fixes 
Merge Brian - Puts back in support for COM_KILL, Also adds back in the INTERACTIVE flag, and creates a DD to track sessions/check on usage
Merge Olaf - Use List::size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include <config.h>
22
 
#include <drizzled/show.h>
 
22
 
 
23
#include <drizzled/kill.h>
23
24
#include <drizzled/session.h>
24
 
#include <drizzled/session/cache.h>
25
25
#include <drizzled/statement/kill.h>
26
26
 
27
27
namespace drizzled
45
45
 
46
46
} // namespace statement
47
47
 
48
 
bool statement::Kill::kill(session_id_t id, bool only_kill_query)
49
 
{
50
 
  drizzled::Session::shared_ptr session_param= session::Cache::singleton().find(id);
51
 
 
52
 
  if (session_param and session_param->isViewable(*getSession()->user()))
53
 
  {
54
 
    session_param->awake(only_kill_query ? Session::KILL_QUERY : Session::KILL_CONNECTION);
55
 
    return true;
56
 
  }
57
 
 
58
 
  return false;
59
 
}
60
 
 
61
48
bool statement::Kill::execute()
62
49
{
63
50
  Item *it= (Item *) getSession()->getLex()->value_list.head();
70
57
    return true;
71
58
  }
72
59
 
73
 
  if (kill(static_cast<session_id_t>(it->val_int()), getSession()->getLex()->type & ONLY_KILL_QUERY))
 
60
  if (drizzled::kill(*getSession()->user(), static_cast<session_id_t>(it->val_int()), getSession()->getLex()->type & ONLY_KILL_QUERY))
74
61
  {
75
62
    getSession()->my_ok();
76
63
  }