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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
75177d9c
Commit
75177d9c
authored
Feb 27, 2007
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql.com:/home/bar/mysql-5.0.b24478
parents
e9481608
8f97dea5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
5 deletions
+96
-5
mysql-test/r/rpl_replicate_do.result
mysql-test/r/rpl_replicate_do.result
+34
-0
mysql-test/t/rpl_replicate_do.test
mysql-test/t/rpl_replicate_do.test
+32
-0
sql/sql_parse.cc
sql/sql_parse.cc
+25
-0
sql/sql_trigger.cc
sql/sql_trigger.cc
+1
-5
sql/sql_trigger.h
sql/sql_trigger.h
+4
-0
No files found.
mysql-test/r/rpl_replicate_do.result
View file @
75177d9c
...
...
@@ -41,3 +41,37 @@ select * from t1;
ts
2005-08-12 00:00:00
drop table t1;
*** master ***
create table t1 (a int, b int);
create trigger trg1 before insert on t1 for each row set new.b=2;
create table t2 (a int, b int);
create trigger trg2 before insert on t2 for each row set new.b=2;
show tables;
Tables_in_test
t1
t2
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost
trg2 INSERT t2 set new.b=2 BEFORE NULL root@localhost
*** slave ***
show tables;
Tables_in_test
t1
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 set new.b=2 BEFORE NULL root@localhost
*** master ***
drop trigger trg1;
drop trigger trg2;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
*** slave ***
show tables;
Tables_in_test
t1
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
*** master ***
drop table t1;
drop table t2;
mysql-test/t/rpl_replicate_do.test
View file @
75177d9c
...
...
@@ -59,3 +59,35 @@ drop table t1;
sync_slave_with_master
;
# End of 4.1 tests
#
# Bug#24478 DROP TRIGGER is not caught by replicate-*-table filters
#
--
echo
***
master
***
connection
master
;
create
table
t1
(
a
int
,
b
int
);
create
trigger
trg1
before
insert
on
t1
for
each
row
set
new
.
b
=
2
;
create
table
t2
(
a
int
,
b
int
);
create
trigger
trg2
before
insert
on
t2
for
each
row
set
new
.
b
=
2
;
show
tables
;
show
triggers
;
sync_slave_with_master
;
--
echo
***
slave
***
connection
slave
;
show
tables
;
show
triggers
;
--
echo
***
master
***
connection
master
;
drop
trigger
trg1
;
drop
trigger
trg2
;
show
triggers
;
sync_slave_with_master
;
--
echo
***
slave
***
connection
slave
;
show
tables
;
show
triggers
;
--
echo
***
master
***
connection
master
;
drop
table
t1
;
drop
table
t2
;
sync_slave_with_master
;
sql/sql_parse.cc
View file @
75177d9c
...
...
@@ -32,6 +32,7 @@
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
#include "sql_trigger.h"
#ifdef HAVE_OPENSSL
/*
...
...
@@ -2491,6 +2492,30 @@ mysql_execute_command(THD *thd)
#ifdef HAVE_REPLICATION
if
(
unlikely
(
thd
->
slave_thread
))
{
if
(
lex
->
sql_command
==
SQLCOM_DROP_TRIGGER
)
{
/*
When dropping a trigger, we need to load its table name
before checking slave filter rules.
*/
add_table_for_trigger
(
thd
,
thd
->
lex
->
spname
,
1
,
&
all_tables
);
if
(
!
all_tables
)
{
/*
If table name cannot be loaded,
it means the trigger does not exists possibly because
CREATE TRIGGER was previously skipped for this trigger
according to slave filtering rules.
Returning success without producing any errors in this case.
*/
DBUG_RETURN
(
0
);
}
// force searching in slave.cc:tables_ok()
all_tables
->
updating
=
1
;
}
/*
Check if statment should be skipped because of slave filtering
rules
...
...
sql/sql_trigger.cc
View file @
75177d9c
...
...
@@ -106,10 +106,6 @@ const LEX_STRING trg_event_type_names[]=
};
static
int
add_table_for_trigger
(
THD
*
thd
,
sp_name
*
trig
,
bool
if_exists
,
TABLE_LIST
**
table
);
class
Handle_old_incorrect_sql_modes_hook
:
public
Unknown_key_hook
{
private:
...
...
@@ -1182,7 +1178,7 @@ bool Table_triggers_list::get_trigger_info(THD *thd, trg_event_type event,
1 Error
*/
static
int
int
add_table_for_trigger
(
THD
*
thd
,
sp_name
*
trig
,
bool
if_exists
,
TABLE_LIST
**
table
)
{
...
...
sql/sql_trigger.h
View file @
75177d9c
...
...
@@ -139,3 +139,7 @@ private:
extern
const
LEX_STRING
trg_action_time_type_names
[];
extern
const
LEX_STRING
trg_event_type_names
[];
int
add_table_for_trigger
(
THD
*
thd
,
sp_name
*
trig
,
bool
if_exists
,
TABLE_LIST
**
table
);
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