Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c6d85289
Commit
c6d85289
authored
Mar 21, 2005
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#2472:
Renamed Table_filter to Rpl_filter Eliminated very annoying memory leak
parent
7ed7fc7f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
70 additions
and
68 deletions
+70
-68
sql/Makefile.am
sql/Makefile.am
+6
-5
sql/log.cc
sql/log.cc
+1
-1
sql/log_event.cc
sql/log_event.cc
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+7
-8
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+1
-1
sql/rpl_filter.cc
sql/rpl_filter.cc
+38
-36
sql/rpl_filter.h
sql/rpl_filter.h
+8
-8
sql/slave.cc
sql/slave.cc
+1
-1
sql/slave.h
sql/slave.h
+2
-2
sql/sql_acl.h
sql/sql_acl.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sql_repl.cc
sql/sql_repl.cc
+1
-1
sql/sql_repl.h
sql/sql_repl.h
+2
-2
No files found.
sql/Makefile.am
View file @
c6d85289
...
...
@@ -55,10 +55,10 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
ha_ndbcluster.h opt_range.h protocol.h
\
sql_select.h structs.h table.h sql_udf.h hash_filo.h
\
lex.h lex_symbol.h sql_acl.h sql_crypt.h
\
log_event.h sql_repl.h slave.h
\
log_event.h sql_repl.h slave.h
rpl_filter.h
\
stacktrace.h sql_sort.h sql_cache.h set_var.h
\
spatial.h gstream.h client_settings.h tzfile.h
\
table_filter.h
tztime.h
\
spatial.h gstream.h client_settings.h tzfile.h
tztime.h
\
sp_head.h
sp_pcontext.h
sp_rcontext.h
sp.h
sp_cache.h
\
parse_file.h
sql_view.h
sql_trigger.h
\
examples/ha_example.h
examples/ha_archive.h
\
...
...
@@ -90,12 +90,13 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc
\
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc
\
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc
\
slave.cc sql_repl.cc sql_union.cc sql_derived.cc
\
slave.cc sql_repl.cc rpl_filter.cc
\
sql_union.cc sql_derived.cc
\
client.c sql_client.cc mini_client_errors.c pack.c
\
stacktrace.c repl_failsafe.h repl_failsafe.cc
\
sql_olap.cc sql_view.cc
\
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc
\
t
able_filter.cc t
ztime.cc my_time.c
\
tztime.cc my_time.c
\
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc
\
sp_cache.cc parse_file.cc sql_trigger.cc
\
examples/ha_example.cc examples/ha_archive.cc
\
...
...
sql/log.cc
View file @
c6d85289
...
...
@@ -24,7 +24,7 @@
#include "mysql_priv.h"
#include "sql_repl.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include "ha_innodb.h" // necessary to cut the binlog when crash recovery
#include <my_dir.h>
...
...
sql/log_event.cc
View file @
c6d85289
...
...
@@ -21,7 +21,7 @@
#endif
#include "mysql_priv.h"
#include "slave.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include <my_dir.h>
#endif
/* MYSQL_CLIENT */
...
...
sql/mysqld.cc
View file @
c6d85289
...
...
@@ -19,7 +19,7 @@
#include <my_dir.h>
#include "slave.h"
#include "sql_repl.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include "repl_failsafe.h"
#include "stacktrace.h"
#include "mysqld_suffix.h"
...
...
@@ -385,8 +385,8 @@ FILE *bootstrap_file;
I_List
<
THD
>
threads
,
thread_cache
;
I_List
<
NAMED_LIST
>
key_caches
;
Table
_filter
*
rpl_filter
;
Table
_filter
*
binlog_filter
;
Rpl
_filter
*
rpl_filter
;
Rpl
_filter
*
binlog_filter
;
struct
system_variables
global_system_variables
;
struct
system_variables
max_system_variables
;
...
...
@@ -994,6 +994,8 @@ void clean_up(bool print_message)
#ifdef HAVE_REPLICATION
end_slave_list
();
#endif
delete
binlog_filter
;
delete
rpl_filter
;
#ifdef HAVE_OPENSSL
if
(
ssl_acceptor_fd
)
my_free
((
gptr
)
ssl_acceptor_fd
,
MYF
(
MY_ALLOW_ZERO_PTR
));
...
...
@@ -2963,8 +2965,8 @@ int main(int argc, char **argv)
{
DEBUGGER_OFF
;
rpl_filter
=
new
Table
_filter
;
binlog_filter
=
new
Table
_filter
;
rpl_filter
=
new
Rpl
_filter
;
binlog_filter
=
new
Rpl
_filter
;
if
(
!
rpl_filter
||
!
binlog_filter
)
{
sql_perror
(
"Could not allocate replication and binlog filters"
);
...
...
@@ -3215,9 +3217,6 @@ we force server id to 2, but this MySQL server will not act as a slave.");
clean_up_mutexes
();
my_end
(
opt_endinfo
?
MY_CHECK_ERROR
|
MY_GIVE_INFO
:
0
);
delete
rpl_filter
;
delete
binlog_filter
;
exit
(
0
);
return
(
0
);
/* purecov: deadcode */
}
...
...
sql/repl_failsafe.cc
View file @
c6d85289
...
...
@@ -20,7 +20,7 @@
#include "repl_failsafe.h"
#include "sql_repl.h"
#include "slave.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include "log_event.h"
#include <mysql.h>
...
...
sql/
table
_filter.cc
→
sql/
rpl
_filter.cc
View file @
c6d85289
...
...
@@ -15,12 +15,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mysql_priv.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#define TABLE_RULE_HASH_SIZE 16
#define TABLE_RULE_ARR_SIZE 16
Table_filter
::
Table
_filter
()
:
Rpl_filter
::
Rpl
_filter
()
:
table_rules_on
(
0
),
do_table_inited
(
0
),
ignore_table_inited
(
0
),
wild_do_table_inited
(
0
),
wild_ignore_table_inited
(
0
)
{
...
...
@@ -30,7 +30,7 @@ Table_filter::Table_filter() :
}
Table_filter
::~
Table
_filter
()
Rpl_filter
::~
Rpl
_filter
()
{
if
(
do_table_inited
)
hash_free
(
&
do_table
);
...
...
@@ -85,10 +85,10 @@ Table_filter::~Table_filter()
*/
bool
Table
_filter
::
tables_ok
(
const
char
*
db
,
TABLE_LIST
*
tables
)
Rpl
_filter
::
tables_ok
(
const
char
*
db
,
TABLE_LIST
*
tables
)
{
bool
some_tables_updating
=
0
;
DBUG_ENTER
(
"
Table
_filter::tables_ok"
);
DBUG_ENTER
(
"
Rpl
_filter::tables_ok"
);
for
(;
tables
;
tables
=
tables
->
next_global
)
{
...
...
@@ -144,9 +144,9 @@ Table_filter::tables_ok(const char* db, TABLE_LIST* tables)
*/
bool
Table
_filter
::
db_ok
(
const
char
*
db
)
Rpl
_filter
::
db_ok
(
const
char
*
db
)
{
DBUG_ENTER
(
"
Table
_filter::db_ok"
);
DBUG_ENTER
(
"
Rpl
_filter::db_ok"
);
if
(
do_db
.
is_empty
()
&&
ignore_db
.
is_empty
())
DBUG_RETURN
(
1
);
// Ok to replicate if the user puts no constraints
...
...
@@ -216,9 +216,9 @@ Table_filter::db_ok(const char* db)
*/
bool
Table
_filter
::
db_ok_with_wild_table
(
const
char
*
db
)
Rpl
_filter
::
db_ok_with_wild_table
(
const
char
*
db
)
{
DBUG_ENTER
(
"
Table
_filter::db_ok_with_wild_table"
);
DBUG_ENTER
(
"
Rpl
_filter::db_ok_with_wild_table"
);
char
hash_key
[
NAME_LEN
+
2
];
char
*
end
;
...
...
@@ -247,16 +247,16 @@ Table_filter::db_ok_with_wild_table(const char *db)
bool
Table
_filter
::
is_on
()
Rpl
_filter
::
is_on
()
{
return
table_rules_on
;
}
int
Table
_filter
::
add_do_table
(
const
char
*
table_spec
)
Rpl
_filter
::
add_do_table
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"
Table
_filter::add_do_table"
);
DBUG_ENTER
(
"
Rpl
_filter::add_do_table"
);
if
(
!
do_table_inited
)
init_table_rule_hash
(
&
do_table
,
&
do_table_inited
);
table_rules_on
=
1
;
...
...
@@ -265,9 +265,9 @@ Table_filter::add_do_table(const char* table_spec)
int
Table
_filter
::
add_ignore_table
(
const
char
*
table_spec
)
Rpl
_filter
::
add_ignore_table
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"
Table
_filter::add_ignore_table"
);
DBUG_ENTER
(
"
Rpl
_filter::add_ignore_table"
);
if
(
!
ignore_table_inited
)
init_table_rule_hash
(
&
ignore_table
,
&
ignore_table_inited
);
table_rules_on
=
1
;
...
...
@@ -276,9 +276,9 @@ Table_filter::add_ignore_table(const char* table_spec)
int
Table
_filter
::
add_wild_do_table
(
const
char
*
table_spec
)
Rpl
_filter
::
add_wild_do_table
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"
Table
_filter::add_wild_do_table"
);
DBUG_ENTER
(
"
Rpl
_filter::add_wild_do_table"
);
if
(
!
wild_do_table_inited
)
init_table_rule_array
(
&
wild_do_table
,
&
wild_do_table_inited
);
table_rules_on
=
1
;
...
...
@@ -287,9 +287,9 @@ Table_filter::add_wild_do_table(const char* table_spec)
int
Table
_filter
::
add_wild_ignore_table
(
const
char
*
table_spec
)
Rpl
_filter
::
add_wild_ignore_table
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"
Table
_filter::add_wild_ignore_table"
);
DBUG_ENTER
(
"
Rpl
_filter::add_wild_ignore_table"
);
if
(
!
wild_ignore_table_inited
)
init_table_rule_array
(
&
wild_ignore_table
,
&
wild_ignore_table_inited
);
table_rules_on
=
1
;
...
...
@@ -298,7 +298,7 @@ Table_filter::add_wild_ignore_table(const char* table_spec)
void
Table
_filter
::
add_db_rewrite
(
const
char
*
from_db
,
const
char
*
to_db
)
Rpl
_filter
::
add_db_rewrite
(
const
char
*
from_db
,
const
char
*
to_db
)
{
i_string_pair
*
db_pair
=
new
i_string_pair
(
from_db
,
to_db
);
rewrite_db
.
push_back
(
db_pair
);
...
...
@@ -306,7 +306,7 @@ Table_filter::add_db_rewrite(const char* from_db, const char* to_db)
int
Table
_filter
::
add_table_rule
(
HASH
*
h
,
const
char
*
table_spec
)
Rpl
_filter
::
add_table_rule
(
HASH
*
h
,
const
char
*
table_spec
)
{
const
char
*
dot
=
strchr
(
table_spec
,
'.'
);
if
(
!
dot
)
return
1
;
...
...
@@ -329,7 +329,7 @@ Table_filter::add_table_rule(HASH* h, const char* table_spec)
*/
int
Table
_filter
::
add_wild_table_rule
(
DYNAMIC_ARRAY
*
a
,
const
char
*
table_spec
)
Rpl
_filter
::
add_wild_table_rule
(
DYNAMIC_ARRAY
*
a
,
const
char
*
table_spec
)
{
const
char
*
dot
=
strchr
(
table_spec
,
'.'
);
if
(
!
dot
)
return
1
;
...
...
@@ -347,16 +347,18 @@ Table_filter::add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec)
void
Table
_filter
::
add_do_db
(
const
char
*
table_spec
)
Rpl
_filter
::
add_do_db
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"Rpl_filter::add_do_db"
);
i_string
*
db
=
new
i_string
(
table_spec
);
do_db
.
push_back
(
db
);
}
void
Table
_filter
::
add_ignore_db
(
const
char
*
table_spec
)
Rpl
_filter
::
add_ignore_db
(
const
char
*
table_spec
)
{
DBUG_ENTER
(
"Rpl_filter::add_ignore_db"
);
i_string
*
db
=
new
i_string
(
table_spec
);
ignore_db
.
push_back
(
db
);
}
...
...
@@ -381,7 +383,7 @@ static void free_table_ent(void* a)
void
Table
_filter
::
init_table_rule_hash
(
HASH
*
h
,
bool
*
h_inited
)
Rpl
_filter
::
init_table_rule_hash
(
HASH
*
h
,
bool
*
h_inited
)
{
hash_init
(
h
,
system_charset_info
,
TABLE_RULE_HASH_SIZE
,
0
,
0
,
get_table_key
,
free_table_ent
,
0
);
...
...
@@ -390,7 +392,7 @@ Table_filter::init_table_rule_hash(HASH* h, bool* h_inited)
void
Table
_filter
::
init_table_rule_array
(
DYNAMIC_ARRAY
*
a
,
bool
*
a_inited
)
Rpl
_filter
::
init_table_rule_array
(
DYNAMIC_ARRAY
*
a
,
bool
*
a_inited
)
{
my_init_dynamic_array
(
a
,
sizeof
(
TABLE_RULE_ENT
*
),
TABLE_RULE_ARR_SIZE
,
TABLE_RULE_ARR_SIZE
);
...
...
@@ -399,7 +401,7 @@ Table_filter::init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited)
TABLE_RULE_ENT
*
Table
_filter
::
find_wild
(
DYNAMIC_ARRAY
*
a
,
const
char
*
key
,
int
len
)
Rpl
_filter
::
find_wild
(
DYNAMIC_ARRAY
*
a
,
const
char
*
key
,
int
len
)
{
uint
i
;
const
char
*
key_end
=
key
+
len
;
...
...
@@ -420,7 +422,7 @@ Table_filter::find_wild(DYNAMIC_ARRAY *a, const char* key, int len)
void
Table
_filter
::
free_string_array
(
DYNAMIC_ARRAY
*
a
)
Rpl
_filter
::
free_string_array
(
DYNAMIC_ARRAY
*
a
)
{
uint
i
;
for
(
i
=
0
;
i
<
a
->
elements
;
i
++
)
...
...
@@ -447,7 +449,7 @@ Table_filter::free_string_array(DYNAMIC_ARRAY *a)
*/
void
Table
_filter
::
table_rule_ent_hash_to_str
(
String
*
s
,
HASH
*
h
)
Rpl
_filter
::
table_rule_ent_hash_to_str
(
String
*
s
,
HASH
*
h
)
{
s
->
length
(
0
);
for
(
uint
i
=
0
;
i
<
h
->
records
;
i
++
)
...
...
@@ -461,7 +463,7 @@ Table_filter::table_rule_ent_hash_to_str(String* s, HASH* h)
void
Table
_filter
::
table_rule_ent_dynamic_array_to_str
(
String
*
s
,
DYNAMIC_ARRAY
*
a
)
Rpl
_filter
::
table_rule_ent_dynamic_array_to_str
(
String
*
s
,
DYNAMIC_ARRAY
*
a
)
{
s
->
length
(
0
);
for
(
uint
i
=
0
;
i
<
a
->
elements
;
i
++
)
...
...
@@ -476,35 +478,35 @@ Table_filter::table_rule_ent_dynamic_array_to_str(String* s, DYNAMIC_ARRAY* a)
void
Table
_filter
::
get_do_table
(
String
*
str
)
Rpl
_filter
::
get_do_table
(
String
*
str
)
{
table_rule_ent_hash_to_str
(
str
,
&
do_table
);
}
void
Table
_filter
::
get_ignore_table
(
String
*
str
)
Rpl
_filter
::
get_ignore_table
(
String
*
str
)
{
table_rule_ent_hash_to_str
(
str
,
&
ignore_table
);
}
void
Table
_filter
::
get_wild_do_table
(
String
*
str
)
Rpl
_filter
::
get_wild_do_table
(
String
*
str
)
{
table_rule_ent_dynamic_array_to_str
(
str
,
&
wild_do_table
);
}
void
Table
_filter
::
get_wild_ignore_table
(
String
*
str
)
Rpl
_filter
::
get_wild_ignore_table
(
String
*
str
)
{
table_rule_ent_dynamic_array_to_str
(
str
,
&
wild_ignore_table
);
}
const
char
*
Table
_filter
::
get_rewrite_db
(
const
char
*
db
,
uint32
*
new_len
)
Rpl
_filter
::
get_rewrite_db
(
const
char
*
db
,
uint32
*
new_len
)
{
if
(
rewrite_db
.
is_empty
()
||
!
db
)
return
db
;
...
...
@@ -524,14 +526,14 @@ Table_filter::get_rewrite_db(const char* db, uint32 *new_len)
I_List
<
i_string
>*
Table
_filter
::
get_do_db
()
Rpl
_filter
::
get_do_db
()
{
return
&
do_db
;
}
I_List
<
i_string
>*
Table
_filter
::
get_ignore_db
()
Rpl
_filter
::
get_ignore_db
()
{
return
&
ignore_db
;
}
sql/
table
_filter.h
→
sql/
rpl
_filter.h
View file @
c6d85289
...
...
@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef __
TABLE
_FILTER_H__
#define __
TABLE
_FILTER_H__
#ifndef __
RPL
_FILTER_H__
#define __
RPL
_FILTER_H__
#include "mysql.h"
#include "my_list.h"
...
...
@@ -28,19 +28,19 @@ typedef struct st_table_rule_ent
}
TABLE_RULE_ENT
;
/*
Table
_filter
Rpl
_filter
Inclusion and exclusion rules of tables and databases.
Also handles rewrites of db.
Used for replication and binlogging.
*/
class
Table
_filter
class
Rpl
_filter
{
public:
Table
_filter
();
~
Table
_filter
();
Table_filter
(
Table
_filter
const
&
);
Table_filter
&
operator
=
(
Table
_filter
const
&
);
Rpl
_filter
();
~
Rpl
_filter
();
Rpl_filter
(
Rpl
_filter
const
&
);
Rpl_filter
&
operator
=
(
Rpl
_filter
const
&
);
/* Checks - returns true if ok to replicate/log */
...
...
sql/slave.cc
View file @
c6d85289
...
...
@@ -22,7 +22,7 @@
#include <myisam.h>
#include "slave.h"
#include "sql_repl.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include "repl_failsafe.h"
#include <thr_alarm.h>
#include <my_dir.h>
...
...
sql/slave.h
View file @
c6d85289
...
...
@@ -21,13 +21,13 @@
#include "mysql.h"
#include "my_list.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#define SLAVE_NET_TIMEOUT 3600
#define MAX_SLAVE_ERRMSG 1024
#define MAX_SLAVE_ERROR 2000
extern
Table
_filter
*
rpl_filter
;
extern
Rpl
_filter
*
rpl_filter
;
/*****************************************************************************
...
...
sql/sql_acl.h
View file @
c6d85289
...
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "slave.h" // for tables_ok(), rpl_filter
extern
Table
_filter
*
rpl_filter
;
extern
Rpl
_filter
*
rpl_filter
;
#define SELECT_ACL (1L << 0)
#define INSERT_ACL (1L << 1)
...
...
sql/sql_parse.cc
View file @
c6d85289
...
...
@@ -16,7 +16,7 @@
#include "mysql_priv.h"
#include "sql_repl.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include "repl_failsafe.h"
#include <m_ctype.h>
#include <myisam.h>
...
...
sql/sql_repl.cc
View file @
c6d85289
...
...
@@ -19,7 +19,7 @@
#include "sql_repl.h"
#include "log_event.h"
#include "
table
_filter.h"
#include "
rpl
_filter.h"
#include <my_dir.h>
int
max_binlog_dump_events
=
0
;
// unlimited
...
...
sql/sql_repl.h
View file @
c6d85289
...
...
@@ -17,8 +17,8 @@
#ifdef HAVE_REPLICATION
#include "slave.h"
extern
Table
_filter
*
binlog_filter
;
extern
Table
_filter
*
rpl_filter
;
extern
Rpl
_filter
*
binlog_filter
;
extern
Rpl
_filter
*
rpl_filter
;
typedef
struct
st_slave_info
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment