1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
10
#include <drizzled/session.h>
11
#include <drizzled/function/str/strfunc.h>
13
using namespace drizzled;
15
#define SHUTDOWN_MESSAGE "Beginning shutdown"
17
class Shutdown :public Item_str_func
25
void fix_length_and_dec()
27
max_length= sizeof(SHUTDOWN_MESSAGE) * system_charset_info->mbmaxlen;
30
const char *func_name() const { return "shutdown"; }
31
const char *fully_qualified_func_name() const { return "shutdown()"; }
33
String *val_str(String *str)
37
str->copy(SHUTDOWN_MESSAGE, sizeof(SHUTDOWN_MESSAGE) -1, system_charset_info);
43
static int initialize(drizzled::module::Context &context)
45
context.add(new plugin::Create_function<Shutdown>("shutdown"));
49
DRIZZLE_DECLARE_PLUGIN
55
"Cause the database to shutdown.",
57
initialize, /* Plugin Init */
58
NULL, /* system variables */
59
NULL /* config options */
61
DRIZZLE_DECLARE_PLUGIN_END;