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
5c7d7364
Commit
5c7d7364
authored
Apr 13, 2004
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
parents
cfc019af
066382e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
2 deletions
+61
-2
mysql-test/r/rpl_multi_delete2.result
mysql-test/r/rpl_multi_delete2.result
+21
-0
mysql-test/t/rpl_multi_delete2-slave.opt
mysql-test/t/rpl_multi_delete2-slave.opt
+1
-0
mysql-test/t/rpl_multi_delete2.test
mysql-test/t/rpl_multi_delete2.test
+23
-0
sql/slave.cc
sql/slave.cc
+16
-2
No files found.
mysql-test/r/rpl_multi_delete2.result
0 → 100644
View file @
5c7d7364
slave stop;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
create table t1 (a int);
create table t2 (a int);
insert into t1 values (1);
insert into t2 values (1);
delete t1.* from t1, t2 where t1.a = t2.a;
select * from t1;
a
select * from t2;
a
1
select * from t1;
Table 'test.t1' doesn't exist
select * from t2;
Table 'test.t2' doesn't exist
drop table t1,t2;
mysql-test/t/rpl_multi_delete2-slave.opt
0 → 100644
View file @
5c7d7364
--replicate-wild-ignore-table=test.%
mysql-test/t/rpl_multi_delete2.test
0 → 100644
View file @
5c7d7364
source
include
/
master
-
slave
.
inc
;
create
table
t1
(
a
int
);
create
table
t2
(
a
int
);
insert
into
t1
values
(
1
);
insert
into
t2
values
(
1
);
delete
t1
.*
from
t1
,
t2
where
t1
.
a
=
t2
.
a
;
save_master_pos
;
select
*
from
t1
;
select
*
from
t2
;
connection
slave
;
# BUG#3461 would cause sync to fail
sync_with_master
;
error
1146
;
select
*
from
t1
;
error
1146
;
select
*
from
t2
;
connection
master
;
drop
table
t1
,
t2
;
sql/slave.cc
View file @
5c7d7364
...
...
@@ -699,7 +699,16 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len)
Note that changing the order of the tables in the list can lead to
different results. Note also the order of precedence of the do/ignore
rules (see code below). For that reason, users should not set conflicting
rules because they may get unpredicted results.
rules because they may get unpredicted results (precedence order is
explained in the manual).
If no table of the list is marked "updating" (so far this can only happen
if the statement is a multi-delete (SQLCOM_DELETE_MULTI) and the "tables"
is the tables in the FROM): then we always return 0, because there is no
reason we play this statement on this slave if it updates nothing. In the
case of SQLCOM_DELETE_MULTI, there will be a second call to tables_ok(),
with tables having "updating==TRUE" (those after the DELETE), so this
second call will make the decision (because
all_tables_not_ok() = !tables_ok(1st_list) && !tables_ok(2nd_list)).
RETURN VALUES
0 should not be logged/replicated
...
...
@@ -708,6 +717,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len)
int
tables_ok
(
THD
*
thd
,
TABLE_LIST
*
tables
)
{
bool
some_tables_updating
=
0
;
DBUG_ENTER
(
"tables_ok"
);
for
(;
tables
;
tables
=
tables
->
next
)
...
...
@@ -718,6 +728,7 @@ int tables_ok(THD* thd, TABLE_LIST* tables)
if
(
!
tables
->
updating
)
continue
;
some_tables_updating
=
1
;
end
=
strmov
(
hash_key
,
tables
->
db
?
tables
->
db
:
thd
->
db
);
*
end
++=
'.'
;
len
=
(
uint
)
(
strmov
(
end
,
tables
->
real_name
)
-
hash_key
);
...
...
@@ -740,10 +751,13 @@ int tables_ok(THD* thd, TABLE_LIST* tables)
}
/*
If no table was to be updated, ignore statement (no reason we play it on
slave, slave is supposed to replicate _changes_ only).
If no explicit rule found and there was a do list, do not replicate.
If there was no do list, go ahead
*/
DBUG_RETURN
(
!
do_table_inited
&&
!
wild_do_table_inited
);
DBUG_RETURN
(
some_tables_updating
&&
!
do_table_inited
&&
!
wild_do_table_inited
);
}
...
...
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