~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

Style changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <drizzled/sql_base.h>
36
36
#include <drizzled/lock.h>
37
37
#include <drizzled/errmsg_print.h>
38
 
#include <drizzled/replication_services.h>
 
38
#include <drizzled/transaction_services.h>
39
39
#include <drizzled/message/schema.pb.h>
40
40
#include "drizzled/sql_table.h"
41
41
#include "drizzled/plugin/storage_engine.h"
81
81
 
82
82
bool mysql_create_db(Session *session, const message::Schema &schema_message, const bool is_if_not_exists)
83
83
{
84
 
  ReplicationServices &replication_services= ReplicationServices::singleton();
 
84
  TransactionServices &transaction_services= TransactionServices::singleton();
85
85
  bool error= false;
86
86
 
87
87
  /*
130
130
  }
131
131
  else // Created !
132
132
  {
133
 
    replication_services.createSchema(session, schema_message);
 
133
    transaction_services.createSchema(session, schema_message);
134
134
    session->my_ok(1);
135
135
  }
136
136
 
145
145
 
146
146
bool mysql_alter_db(Session *session, const message::Schema &schema_message)
147
147
{
148
 
  ReplicationServices &replication_services= ReplicationServices::singleton();
 
148
  TransactionServices &transaction_services= TransactionServices::singleton();
149
149
 
150
150
  /*
151
151
    Do not alter database if another thread is holding read lock.
175
175
 
176
176
  if (success)
177
177
  {
178
 
    replication_services.rawStatement(session, session->getQueryString());
 
178
    transaction_services.rawStatement(session, session->getQueryString());
179
179
    session->my_ok(1);
180
180
  }
181
181
  else
275
275
  {
276
276
    assert(! session->query.empty());
277
277
 
278
 
    ReplicationServices &replication_services= ReplicationServices::singleton();
279
 
    replication_services.dropSchema(session, schema_name);
 
278
    TransactionServices &transaction_services= TransactionServices::singleton();
 
279
    transaction_services.dropSchema(session, schema_name);
280
280
    session->clear_error();
281
281
    session->server_status|= SERVER_STATUS_DB_DROPPED;
282
282
    session->my_ok((uint32_t) deleted);
293
293
    query_end= query + MAX_DROP_TABLE_Q_LEN;
294
294
    db_len= schema_name.length();
295
295
 
296
 
    ReplicationServices &replication_services= ReplicationServices::singleton();
 
296
    TransactionServices &transaction_services= TransactionServices::singleton();
297
297
    for (plugin::TableNameList::iterator it= dropped_tables.begin();
298
298
         it != dropped_tables.end();
299
299
         it++)
305
305
      if (query_pos + tbl_name_len + 1 >= query_end)
306
306
      {
307
307
        /* These DDL methods and logging protected with LOCK_create_db */
308
 
        replication_services.rawStatement(session, query);
 
308
        transaction_services.rawStatement(session, query);
309
309
        query_pos= query_data_start;
310
310
      }
311
311
 
318
318
    if (query_pos != query_data_start)
319
319
    {
320
320
      /* These DDL methods and logging protected with LOCK_create_db */
321
 
      replication_services.rawStatement(session, query);
 
321
      transaction_services.rawStatement(session, query);
322
322
    }
323
323
  }
324
324