~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/info_schema_table.cc

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include "drizzled/server_includes.h"
22
 
#include "drizzled/service/info_schema.h"
23
22
#include "drizzled/plugin/info_schema_table.h"
24
23
#include "drizzled/gettext.h"
25
24
#include "drizzled/session.h"
32
31
namespace drizzled
33
32
{
34
33
 
35
 
void service::InfoSchema::add(plugin::InfoSchemaTable *schema_table)
 
34
vector<plugin::InfoSchemaTable *> all_schema_tables;
 
35
 
 
36
 
 
37
void plugin::InfoSchemaTable::add(plugin::InfoSchemaTable *schema_table)
36
38
{
37
39
  if (schema_table->getFirstColumnIndex() == 0)
38
40
    schema_table->setFirstColumnIndex(-1);
42
44
  all_schema_tables.push_back(schema_table);
43
45
}
44
46
 
45
 
void service::InfoSchema::remove(plugin::InfoSchemaTable *table)
 
47
void plugin::InfoSchemaTable::remove(plugin::InfoSchemaTable *table)
46
48
{
47
49
  all_schema_tables.erase(remove_if(all_schema_tables.begin(),
48
50
                                    all_schema_tables.end(),
52
54
}
53
55
 
54
56
 
55
 
namespace service
56
 
{
57
 
namespace i_s_priv
58
 
{
59
 
 
60
57
class AddSchemaTable : public unary_function<plugin::InfoSchemaTable *, bool>
61
58
{
62
59
  Session *session;
109
106
  }
110
107
};
111
108
 
112
 
}
113
 
}
114
 
 
115
 
plugin::InfoSchemaTable *service::InfoSchema::getTable(const char *table_name)
 
109
plugin::InfoSchemaTable *plugin::InfoSchemaTable::getTable(const char *table_name)
116
110
{
117
111
  vector<plugin::InfoSchemaTable *>::iterator iter=
118
112
    find_if(all_schema_tables.begin(),
119
113
            all_schema_tables.end(),
120
 
            service::i_s_priv::FindSchemaTableByName(table_name));
 
114
            FindSchemaTableByName(table_name));
121
115
 
122
116
  if (iter != all_schema_tables.end())
123
117
  {
129
123
}
130
124
 
131
125
 
132
 
int service::InfoSchema::addTableToList(Session *session,
 
126
int plugin::InfoSchemaTable::addTableToList(Session *session,
133
127
                                     vector<LEX_STRING*> &files,
134
128
                                     const char *wild)
135
129
{
137
131
  vector<plugin::InfoSchemaTable *>::iterator iter=
138
132
    find_if(all_schema_tables.begin(),
139
133
            all_schema_tables.end(),
140
 
            service::i_s_priv::AddSchemaTable(session, files, wild));
 
134
            AddSchemaTable(session, files, wild));
141
135
 
142
136
  if (iter != all_schema_tables.end())
143
137
  {