~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/schema_engine.cc

  • Committer: Lee Bieber
  • Date: 2011-03-13 16:37:38 UTC
  • mfrom: (2227.4.18 session2)
  • Revision ID: kalebral@gmail.com-20110313163738-7ti21zk40o2xi3ew
Merge Olaf - Refactor Session

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <config.h>
21
21
 
22
22
#include <drizzled/session.h>
23
 
 
 
23
#include <drizzled/sql_base.h>
24
24
#include <drizzled/global_charset_info.h>
25
25
#include <drizzled/charset.h>
26
26
#include <drizzled/transaction_services.h>
34
34
namespace plugin
35
35
{
36
36
 
37
 
class AddSchemaNames : 
 
37
class AddSchemaNames :
38
38
  public std::unary_function<StorageEngine *, void>
39
39
{
40
40
  identifier::Schema::vector &schemas;
70
70
  StorageEngineGetSchemaDefinition(const identifier::Schema &identifier_arg,
71
71
                                   message::schema::shared_ptr &schema_proto_arg) :
72
72
    identifier(identifier_arg),
73
 
    schema_proto(schema_proto_arg) 
 
73
    schema_proto(schema_proto_arg)
74
74
  {
75
75
  }
76
76
 
143
143
  return default_charset_info;
144
144
}
145
145
 
146
 
class CreateSchema : 
 
146
class CreateSchema :
147
147
  public std::unary_function<StorageEngine *, void>
148
148
{
149
149
  const drizzled::message::Schema &schema_message;
162
162
    // @todo eomeday check that at least one engine said "true"
163
163
    bool success= engine->doCreateSchema(schema_message);
164
164
 
165
 
    if (success) 
 
165
    if (success)
166
166
    {
167
167
      success_count++;
168
168
      TransactionServices &transaction_services= TransactionServices::singleton();
178
178
  std::for_each(StorageEngine::getSchemaEngines().begin(), StorageEngine::getSchemaEngines().end(),
179
179
                CreateSchema(schema_message, success_count));
180
180
 
181
 
  if (success_count) 
 
181
  if (success_count)
182
182
  {
183
183
    TransactionServices &transaction_services= TransactionServices::singleton();
184
184
    transaction_services.allocateNewTransactionId();
187
187
  return (bool)success_count;
188
188
}
189
189
 
190
 
class DropSchema : 
 
190
class DropSchema :
191
191
  public std::unary_function<StorageEngine *, void>
192
192
{
193
193
  uint64_t &success_count;
265
265
    // Remove all temp tables first, this prevents loss of table from
266
266
    // shadowing (ie temp over standard table)
267
267
    {
268
 
      // Lets delete the temporary tables first outside of locks.  
 
268
      // Lets delete the temporary tables first outside of locks.
269
269
      identifier::Table::vector set_of_identifiers;
270
270
      session.doGetTableIdentifiers(identifier, set_of_identifiers);
271
271
 
322
322
  return error;
323
323
}
324
324
 
325
 
class AlterSchema : 
 
325
class AlterSchema :
326
326
  public std::unary_function<StorageEngine *, void>
327
327
{
328
328
  uint64_t &success_count;