~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_parse.cc

  • Committer: Brian Aker
  • Date: 2008-11-25 15:24:22 UTC
  • Revision ID: brian@tangent.org-20081125152422-6hchtchktzd2lnjf
Remove filtering (wrong layer, belongs in plugin).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#define DRIZZLE_LEX 1
17
17
#include <drizzled/server_includes.h>
18
18
#include <drizzled/replication/replication.h>
19
 
#include <drizzled/replication/filter.h>
 
19
#include <libdrizzle/libdrizzle.h>
 
20
#include <mysys/hash.h>
20
21
#include <drizzled/replication/binlog.h>
21
22
#include <drizzled/logging.h>
22
23
#include <drizzled/db.h>
134
135
/**
135
136
  Returns true if all tables should be ignored.
136
137
*/
137
 
inline bool all_tables_not_ok(Session *session, TableList *tables)
 
138
inline bool all_tables_not_ok(Session *, TableList *)
138
139
{
139
 
  return rpl_filter->is_on() && tables &&
140
 
         !rpl_filter->tables_ok(session->db, tables);
 
140
  return false;
141
141
}
142
142
 
143
143
 
2073
2073
      my_error(ER_WRONG_DB_NAME, MYF(0), lex->name.str);
2074
2074
      break;
2075
2075
    }
2076
 
    /*
2077
 
      If in a slave thread :
2078
 
      CREATE DATABASE DB was certainly not preceded by USE DB.
2079
 
      For that reason, db_ok() in sql/slave.cc did not check the
2080
 
      do_db/ignore_db. And as this query involves no tables, tables_ok()
2081
 
      above was not called. So we have to check rules again here.
2082
 
    */
2083
 
    if (session->slave_thread && 
2084
 
        (!rpl_filter->db_ok(lex->name.str) ||
2085
 
         !rpl_filter->db_ok_with_wild_table(lex->name.str)))
2086
 
    {
2087
 
      my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
2088
 
      break;
2089
 
    }
2090
2076
    res= mysql_create_db(session,(lower_case_table_names == 2 ? alias :
2091
2077
                              lex->name.str), &create_info, 0);
2092
2078
    break;
2103
2089
      my_error(ER_WRONG_DB_NAME, MYF(0), lex->name.str);
2104
2090
      break;
2105
2091
    }
2106
 
    /*
2107
 
      If in a slave thread :
2108
 
      DROP DATABASE DB may not be preceded by USE DB.
2109
 
      For that reason, maybe db_ok() in sql/slave.cc did not check the 
2110
 
      do_db/ignore_db. And as this query involves no tables, tables_ok()
2111
 
      above was not called. So we have to check rules again here.
2112
 
    */
2113
 
    if (session->slave_thread && 
2114
 
        (!rpl_filter->db_ok(lex->name.str) ||
2115
 
         !rpl_filter->db_ok_with_wild_table(lex->name.str)))
2116
 
    {
2117
 
      my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
2118
 
      break;
2119
 
    }
2120
2092
    if (session->locked_tables || session->active_transaction())
2121
2093
    {
2122
2094
      my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
2135
2107
      my_error(ER_WRONG_DB_NAME, MYF(0), db->str);
2136
2108
      break;
2137
2109
    }
2138
 
    /*
2139
 
      If in a slave thread :
2140
 
      ALTER DATABASE DB may not be preceded by USE DB.
2141
 
      For that reason, maybe db_ok() in sql/slave.cc did not check the
2142
 
      do_db/ignore_db. And as this query involves no tables, tables_ok()
2143
 
      above was not called. So we have to check rules again here.
2144
 
    */
2145
 
    if (session->slave_thread &&
2146
 
        (!rpl_filter->db_ok(db->str) ||
2147
 
         !rpl_filter->db_ok_with_wild_table(db->str)))
2148
 
    {
2149
 
      my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
2150
 
      break;
2151
 
    }
2152
2110
    if (session->locked_tables || session->active_transaction())
2153
2111
    {
2154
2112
      my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,