1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2009 Sun Microsystems, Inc.
4
* Copyright (C) 2009 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
#include <drizzled/kill.h>
21
#include <drizzled/server_includes.h>
22
#include <drizzled/show.h>
24
23
#include <drizzled/session.h>
25
24
#include <drizzled/statement/kill.h>
26
#include <drizzled/sql_lex.h>
31
Kill::Kill(Session *in_session, Item *item, bool is_query_kill) :
36
lex().type= ONLY_KILL_QUERY;
39
lex().value_list.clear();
40
lex().value_list.push_front(item);
41
set_command(SQLCOM_KILL);
44
} // namespace statement
26
using namespace drizzled;
46
28
bool statement::Kill::execute()
48
Item *it= &lex().value_list.front();
30
Item *it= (Item *) session->lex->value_list.head();
50
if ((not it->fixed && it->fix_fields(lex().session, &it)) || it->check_cols(1))
32
if ((! it->fixed && it->fix_fields(session->lex->session, &it)) ||
52
35
my_message(ER_SET_CONSTANTS_ONLY,
53
36
ER(ER_SET_CONSTANTS_ONLY),
58
if (drizzled::kill(*session().user(), static_cast<session_id_t>(it->val_int()), lex().type & ONLY_KILL_QUERY))
64
my_error(ER_NO_SUCH_THREAD, MYF(0), it->val_int());
40
sql_kill(session, (ulong) it->val_int(), session->lex->type & ONLY_KILL_QUERY);
70
} /* namespace drizzled */