~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Brian Aker
  • Date: 2008-11-18 23:19:19 UTC
  • mfrom: (584.1.16 devel)
  • Revision ID: brian@tangent.org-20081118231919-w9sr347dtiwhccml
Merge of Monty's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "log.h"
29
29
#include <drizzled/error.h>
30
30
#include <drizzled/gettext.h>
31
 
 
 
31
#include <mysys/hash.h>
 
32
#include <drizzled/session.h>
 
33
#include <drizzled/db.h>
 
34
#include <drizzled/sql_base.h>
32
35
 
33
36
#define MAX_DROP_TABLE_Q_LEN      1024
34
37
 
37
40
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
38
41
 
39
42
static long mysql_rm_known_files(Session *session, MY_DIR *dirp,
40
 
                                 const char *db, const char *path, uint32_t level, 
 
43
                                 const char *db, const char *path,
 
44
                                 uint32_t level,
41
45
                                 TableList **dropped_tables);
42
 
         
 
46
 
43
47
static bool rm_dir_w_symlink(const char *org_path, bool send_error);
44
48
static void mysql_change_db_impl(Session *session,
45
49
                                 LEX_STRING *new_db_name,
140
144
  qinfo.error_code= 0;
141
145
  qinfo.db= db;
142
146
  qinfo.db_len= db_len;
143
 
  mysql_bin_log.write(&qinfo);
 
147
  drizzle_bin_log.write(&qinfo);
144
148
}  
145
149
 
146
150
 
633
637
      query_length= session->query_length;
634
638
    }
635
639
 
636
 
    if (mysql_bin_log.is_open())
 
640
    if (drizzle_bin_log.is_open())
637
641
    {
638
642
      Query_log_event qinfo(session, query, query_length, 0, 
639
643
                            /* suppress_use */ true);
659
663
      qinfo.db_len = strlen(db);
660
664
 
661
665
      /* These DDL methods and logging protected with LOCK_drizzle_create_db */
662
 
      mysql_bin_log.write(&qinfo);
 
666
      drizzle_bin_log.write(&qinfo);
663
667
    }
664
668
    my_ok(session, result);
665
669
  }
716
720
    session->variables.collation_database= session->db_charset;
717
721
  }
718
722
 
719
 
  if (mysql_bin_log.is_open())
 
723
  if (drizzle_bin_log.is_open())
720
724
  {
721
725
    Query_log_event qinfo(session, session->query, session->query_length, 0,
722
726
                          /* suppress_use */ true);
731
735
 
732
736
    session->clear_error();
733
737
    /* These DDL methods and logging protected with LOCK_drizzle_create_db */
734
 
    mysql_bin_log.write(&qinfo);
 
738
    drizzle_bin_log.write(&qinfo);
735
739
  }
736
740
  my_ok(session, result);
737
741
 
851
855
      query =session->query;
852
856
      query_length= session->query_length;
853
857
    }
854
 
    if (mysql_bin_log.is_open())
 
858
    if (drizzle_bin_log.is_open())
855
859
    {
856
860
      Query_log_event qinfo(session, query, query_length, 0, 
857
861
                            /* suppress_use */ true);
865
869
 
866
870
      session->clear_error();
867
871
      /* These DDL methods and logging protected with LOCK_drizzle_create_db */
868
 
      mysql_bin_log.write(&qinfo);
 
872
      drizzle_bin_log.write(&qinfo);
869
873
    }
870
874
    session->clear_error();
871
875
    session->server_status|= SERVER_STATUS_DB_DROPPED;
872
876
    my_ok(session, (uint32_t) deleted);
873
877
    session->server_status&= ~SERVER_STATUS_DB_DROPPED;
874
878
  }
875
 
  else if (mysql_bin_log.is_open())
 
879
  else if (drizzle_bin_log.is_open())
876
880
  {
877
881
    char *query, *query_pos, *query_end, *query_data_start;
878
882
    TableList *tbl;