1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
4
* Copyright (C) 2008 Sun Microsystems, Inc.
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
21
21
#ifndef DRIZZLED_OPEN_TABLES_STATE_H
22
22
#define DRIZZLED_OPEN_TABLES_STATE_H
24
#include "drizzled/lock.h"
24
#include <drizzled/lock.h>
25
#include <drizzled/query_id.h>
30
class CachedDirectory;
30
33
Class that holds information about tables which were opened and locked
31
34
by the thread. It is also used to save/restore this information in
72
76
void close_temporary_tables();
74
79
void close_temporary_table(Table *table);
75
82
// The method below just handles the de-allocation of the table. In
76
83
// a better memory type world, this would not be needed.
78
84
void nukeTable(Table *table);
81
87
/* Work with temporary tables */
82
Table *find_temporary_table(const TableIdentifier &identifier);
88
Table *find_temporary_table(const identifier::Table &identifier);
84
90
void dumpTemporaryTableNames(const char *id);
85
int drop_temporary_table(const drizzled::TableIdentifier &identifier);
86
bool rm_temporary_table(plugin::StorageEngine *base, const TableIdentifier &identifier);
87
bool rm_temporary_table(const drizzled::TableIdentifier &identifier, bool best_effort= false);
88
Table *open_temporary_table(const drizzled::TableIdentifier &identifier,
91
int drop_temporary_table(const drizzled::identifier::Table &identifier);
92
bool rm_temporary_table(plugin::StorageEngine *base, const identifier::Table &identifier);
93
bool rm_temporary_table(const drizzled::identifier::Table &identifier, bool best_effort= false);
94
Table *open_temporary_table(const drizzled::identifier::Table &identifier,
89
95
bool link_in_list= true);
91
97
virtual query_id_t getQueryId() const= 0;
152
158
virtual ~Open_tables_state() {}
154
160
void doGetTableNames(CachedDirectory &directory,
155
const SchemaIdentifier &schema_identifier,
161
const identifier::Schema &schema_identifier,
156
162
std::set<std::string>& set_of_names);
157
void doGetTableNames(const SchemaIdentifier &schema_identifier,
163
void doGetTableNames(const identifier::Schema &schema_identifier,
158
164
std::set<std::string>& set_of_names);
160
166
void doGetTableIdentifiers(CachedDirectory &directory,
161
const SchemaIdentifier &schema_identifier,
162
TableIdentifier::vector &set_of_identifiers);
163
void doGetTableIdentifiers(const SchemaIdentifier &schema_identifier,
164
TableIdentifier::vector &set_of_identifiers);
167
const identifier::Schema &schema_identifier,
168
identifier::Table::vector &set_of_identifiers);
169
void doGetTableIdentifiers(const identifier::Schema &schema_identifier,
170
identifier::Table::vector &set_of_identifiers);
166
int doGetTableDefinition(const drizzled::TableIdentifier &identifier,
172
int doGetTableDefinition(const drizzled::identifier::Table &identifier,
167
173
message::Table &table_proto);
168
bool doDoesTableExist(const drizzled::TableIdentifier &identifier);
174
bool doDoesTableExist(const drizzled::identifier::Table &identifier);
171
177
Open_tables_state(uint64_t version_arg);