drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
plugin/function_engine/function.h
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2009 Sun Microsystems, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#pragma once
22
23#include <assert.h>
24#include <drizzled/plugin/storage_engine.h>
25#include <drizzled/plugin/table_function.h>
26#include <drizzled/identifier/schema.h>
27
28extern const drizzled::charset_info_st *default_charset_info;
29
30static const char *function_exts[] = {
31 NULL
32};
33
34class Function : public drizzled::plugin::StorageEngine
35{
36 drizzled::message::schema::shared_ptr information_message;
37 drizzled::message::schema::shared_ptr data_dictionary_message;
38
39public:
40 Function(const std::string &name_arg);
41
42 ~Function()
43 { }
44
45 drizzled::plugin::TableFunction *getTool(const char *name_arg);
46
47 int doCreateTable(drizzled::Session&,
50 const drizzled::message::Table&)
51 {
52 return drizzled::ER_TABLE_PERMISSION_DENIED;
53 }
54
56 {
57 return drizzled::HA_ERR_NO_SUCH_TABLE;
58 }
59
60 virtual drizzled::Cursor *create(drizzled::Table &table);
61
62 const char **bas_ext() const
63 {
64 return function_exts;
65 }
66
67 drizzled::plugin::TableFunction *getFunction(const std::string &path)
68 {
69 return drizzled::plugin::TableFunction::getFunction(path);
70 }
71
72 bool doCanCreateTable(const drizzled::identifier::Table &identifier);
73
74
75 int doGetTableDefinition(drizzled::Session &session,
76 const drizzled::identifier::Table &identifier,
77 drizzled::message::Table &table_message);
78
79 void doGetSchemaIdentifiers(drizzled::identifier::schema::vector&);
80
81 bool doDoesTableExist(drizzled::Session& session, const drizzled::identifier::Table &identifier);
82
83 drizzled::message::schema::shared_ptr doGetSchemaDefinition(const drizzled::identifier::Schema &schema);
84
85 int doRenameTable(drizzled::Session&, const drizzled::identifier::Table &, const drizzled::identifier::Table &)
86 {
87 return EPERM;
88 }
89
90 void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
91 const drizzled::identifier::Schema &schema_identifier,
92 drizzled::identifier::table::vector &set_of_identifiers);
93};
94
int doDropTable(drizzled::Session &, const drizzled::identifier::Table &)
const char ** bas_ext() const