~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/session_dictionary/processlist.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <drizzled/plugin/authorization.h>
30
30
#include <drizzled/internal/my_sys.h>
31
31
#include <drizzled/internal/thread_var.h>
32
 
 
 
32
#include <drizzled/session/state.h>
 
33
#include <drizzled/session/times.h>
33
34
#include <set>
34
35
 
35
36
using namespace std;
57
58
 
58
59
bool ProcesslistTool::Generator::populate()
59
60
{
60
 
  drizzled::Session::pointer tmp;
61
 
 
62
 
  while ((tmp= session_generator))
 
61
  while (Session* tmp= session_generator)
63
62
  {
64
 
    drizzled::session::State::const_shared_ptr state(tmp->state());
65
 
    identifier::User::const_shared_ptr tmp_sctx= tmp->user();
 
63
    boost::shared_ptr<session::State> state(tmp->state());
 
64
    identifier::user::ptr tmp_sctx= tmp->user();
66
65
 
67
66
    /* ID */
68
67
    push((int64_t) tmp->thread_id);
77
76
    push(tmp_sctx->address());
78
77
 
79
78
    /* DB */
80
 
    drizzled::util::string::const_shared_ptr schema(tmp->schema());
 
79
    util::string::ptr schema(tmp->schema());
81
80
    if (schema and not schema->empty())
82
81
    {
83
82
      push(*schema);
88
87
    }
89
88
 
90
89
    /* COMMAND */
91
 
    const char *val= tmp->getKilled() == Session::KILL_CONNECTION ? "Killed" : NULL;
92
 
    if (val)
 
90
    if (tmp->getKilled() == Session::KILL_CONNECTION)
93
91
    {
94
 
      push(val);
 
92
      push("Killed");
95
93
    }
96
94
    else
97
95
    {
99
97
    }
100
98
 
101
99
    /* type::Time */
102
 
    boost::posix_time::time_duration duration_result;
103
 
    getSession().getTimeDifference(duration_result, getSession().start_timer());
104
 
    duration_result.is_negative() ? push(static_cast<uint64_t>(0)) : push(static_cast<uint64_t>(duration_result.total_seconds()));
 
100
    boost::posix_time::time_duration duration_result= getSession().times.start_timer() - getSession().times._start_timer;
 
101
    push(static_cast<uint64_t>(duration_result.is_negative() ? 0 : duration_result.total_seconds()));
105
102
 
106
103
    /* STATE */
107
104
    const char *step= tmp->get_proc_info();