~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Monty Taylor
  • Date: 2009-05-06 04:37:59 UTC
  • mto: This revision was merged to the branch mainline in revision 1008.
  • Revision ID: mordred@inaugust.com-20090506043759-a7rk3vqddrh52on0
Updated po files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include CINTTYPES_H
21
21
#include <string>
22
22
#include <fstream>
23
 
#include <drizzled/serialize/serialize.h>
 
23
#include <drizzled/message/schema.pb.h>
24
24
using namespace std;
25
25
#include <drizzled/server_includes.h>
26
26
#include <mysys/mysys_err.h>
33
33
#include <drizzled/sql_base.h>
34
34
#include <drizzled/lock.h>
35
35
#include <drizzled/errmsg_print.h>
36
 
#include <drizzled/replicator.h>
 
36
#include <drizzled/transaction_services.h>
 
37
 
 
38
extern drizzled::TransactionServices transaction_services;
37
39
 
38
40
#define MY_DB_OPT_FILE "db.opt"
39
41
#define MAX_DROP_TABLE_Q_LEN      1024
108
110
}
109
111
 
110
112
/*
111
 
  Helper function to write a query to binlog used by mysql_rm_db()
112
 
*/
113
 
 
114
 
static inline void write_to_binlog(Session *session, char *query, uint32_t query_length, char *, uint32_t)
115
 
{
116
 
  (void)replicator_statement(session, query, query_length);
117
 
}
118
 
 
119
 
/*
120
113
  Initialize database option hash and locked database hash.
121
114
 
122
115
  SYNOPSIS
177
170
                             const char *path, const char *name,
178
171
                             HA_CREATE_INFO *create)
179
172
{
180
 
  drizzle::Schema db;
 
173
  drizzled::message::Schema db;
181
174
  char schema_file_tmp[FN_REFLEN];
182
175
  string schema_file(path);
183
176
 
220
213
 
221
214
int load_db_opt(Session *session, const char *path, HA_CREATE_INFO *create)
222
215
{
223
 
  drizzle::Schema db;
 
216
  drizzled::message::Schema db;
224
217
  string buffer;
225
218
 
226
219
  memset(create, 0, sizeof(*create));
380
373
      query_length= session->query_length;
381
374
    }
382
375
 
383
 
    (void)replicator_statement(session, query, query_length);
 
376
    transaction_services.rawStatement(session, query, query_length);
384
377
    session->my_ok(result);
385
378
  }
386
379
 
438
431
    session->variables.collation_database= session->db_charset;
439
432
  }
440
433
 
441
 
  (void)replicator_statement(session, session->query, session->query_length);
 
434
  transaction_services.rawStatement(session, session->getQueryString(), session->getQueryLength());
442
435
  session->my_ok(result);
443
436
 
444
437
  pthread_mutex_unlock(&LOCK_create_db);
548
541
      query= session->query;
549
542
      query_length= session->query_length;
550
543
    }
551
 
    (void)replicator_statement(session, session->query, session->query_length);
 
544
    transaction_services.rawStatement(session, session->getQueryString(), session->getQueryLength());
552
545
    session->clear_error();
553
546
    session->server_status|= SERVER_STATUS_DB_DROPPED;
554
547
    session->my_ok((uint32_t) deleted);
575
568
      if (query_pos + tbl_name_len + 1 >= query_end)
576
569
      {
577
570
        /* These DDL methods and logging protected with LOCK_create_db */
578
 
        write_to_binlog(session, query, query_pos -1 - query, db, db_len);
 
571
        transaction_services.rawStatement(session, query, (size_t) (query_pos -1 - query));
579
572
        query_pos= query_data_start;
580
573
      }
581
574
 
588
581
    if (query_pos != query_data_start)
589
582
    {
590
583
      /* These DDL methods and logging protected with LOCK_create_db */
591
 
      write_to_binlog(session, query, query_pos -1 - query, db, db_len);
 
584
      transaction_services.rawStatement(session, query, (size_t) (query_pos -1 - query));
592
585
    }
593
586
  }
594
587