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
d9c910b0
Commit
d9c910b0
authored
Jun 03, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Plain Diff
BUG 53893: automerged from mysql-5.1-bugteam into mysql-trunk-merge.
parents
ec6285d5
20fc48fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
4 deletions
+107
-4
mysql-test/suite/rpl/r/rpl_row_find_row.result
mysql-test/suite/rpl/r/rpl_row_find_row.result
+12
-0
mysql-test/suite/rpl/t/rpl_row_find_row.test
mysql-test/suite/rpl/t/rpl_row_find_row.test
+31
-0
sql/log_event.cc
sql/log_event.cc
+32
-2
sql/log_event_old.cc
sql/log_event_old.cc
+32
-2
No files found.
mysql-test/suite/rpl/r/rpl_row_
disabled_slave_key
.result
→
mysql-test/suite/rpl/r/rpl_row_
find_row
.result
View file @
d9c910b0
...
...
@@ -24,3 +24,15 @@ INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
DROP TABLE t;
stop slave;
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;
start slave;
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
INSERT INTO t1(c1,c2) VALUES(1,1);
INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
Comparing tables master:test.t1 and slave:test.t1
DROP TABLE t1;
mysql-test/suite/rpl/t/rpl_row_
disabled_slave_key
.test
→
mysql-test/suite/rpl/t/rpl_row_
find_row
.test
View file @
d9c910b0
...
...
@@ -71,3 +71,34 @@ DELETE FROM t;
DROP
TABLE
t
;
--
sync_slave_with_master
#
# BUG#53893: RBR: nullable unique key can lead to out-of-sync slave
#
#
# We insert two rows. Both with part of UNIQUE KEY set to null.
# Then we update the last row inserted. On master the correct
# row is updated. On the slave the wrong row would be updated
# because the engine would look it up by the NULL Unique KEY.
# As a consquence, the wrong row would be updated.
#
--
connection
master
--
source
include
/
master
-
slave
-
reset
.
inc
--
connection
master
CREATE
TABLE
t1
(
c1
INT
NOT
NULL
,
c2
INT
NOT
NULL
,
c3
INT
,
UNIQUE
KEY
(
c1
,
c3
),
KEY
(
c2
));
INSERT
INTO
t1
(
c1
,
c2
)
VALUES
(
1
,
1
);
INSERT
INTO
t1
(
c1
,
c2
)
VALUES
(
1
,
2
);
UPDATE
t1
SET
c1
=
1000
WHERE
c2
=
2
;
--
sync_slave_with_master
--
let
$diff_table_1
=
master
:
test
.
t1
--
let
$diff_table_2
=
slave
:
test
.
t1
--
source
include
/
diff_tables
.
inc
--
connection
master
DROP
TABLE
t1
;
--
sync_slave_with_master
sql/log_event.cc
View file @
d9c910b0
...
...
@@ -9168,8 +9168,38 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
*/
if
(
table
->
key_info
->
flags
&
HA_NOSAME
)
{
table
->
file
->
ha_index_end
();
goto
ok
;
/* Unique does not have non nullable part */
if
(
!
(
table
->
key_info
->
flags
&
(
HA_NULL_PART_KEY
)))
{
table
->
file
->
ha_index_end
();
goto
ok
;
}
else
{
KEY
*
keyinfo
=
table
->
key_info
;
/*
Unique has nullable part. We need to check if there is any field in the
BI image that is null and part of UNNI.
*/
bool
null_found
=
FALSE
;
for
(
uint
i
=
0
,
fieldnr
=
keyinfo
->
key_part
[
i
].
fieldnr
-
1
;
(
i
<
keyinfo
->
key_parts
)
&&
!
null_found
;
i
++
,
fieldnr
=
keyinfo
->
key_part
[
i
].
fieldnr
-
1
)
{
Field
**
f
=
table
->
field
+
fieldnr
;
if
((
*
f
)
->
is_null
())
null_found
=
TRUE
;
}
if
(
!
null_found
)
{
table
->
file
->
ha_index_end
();
goto
ok
;
}
/* else fall through to index scan */
}
}
/*
...
...
sql/log_event_old.cc
View file @
d9c910b0
...
...
@@ -2339,8 +2339,38 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
*/
if
(
table
->
key_info
->
flags
&
HA_NOSAME
)
{
table
->
file
->
ha_index_end
();
DBUG_RETURN
(
0
);
/* Unique does not have non nullable part */
if
(
!
(
table
->
key_info
->
flags
&
(
HA_NULL_PART_KEY
)))
{
table
->
file
->
ha_index_end
();
DBUG_RETURN
(
0
);
}
else
{
KEY
*
keyinfo
=
table
->
key_info
;
/*
Unique has nullable part. We need to check if there is any field in the
BI image that is null and part of UNNI.
*/
bool
null_found
=
FALSE
;
for
(
uint
i
=
0
,
fieldnr
=
keyinfo
->
key_part
[
i
].
fieldnr
-
1
;
(
i
<
keyinfo
->
key_parts
)
&&
!
null_found
;
i
++
,
fieldnr
=
keyinfo
->
key_part
[
i
].
fieldnr
-
1
)
{
Field
**
f
=
table
->
field
+
fieldnr
;
if
((
*
f
)
->
is_null
())
null_found
=
TRUE
;
}
if
(
!
null_found
)
{
table
->
file
->
ha_index_end
();
DBUG_RETURN
(
0
);
}
/* else fall through to index scan */
}
}
/*
...
...
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