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
22cff392
Commit
22cff392
authored
Jan 19, 2010
by
Luis Soares
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#49481 and BUG#49482 reverted.
PB2 run uncovered issue that needs further analysis.
parent
be2a015e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
153 deletions
+2
-153
mysql-test/suite/rpl/r/rpl_myisam_null_values.result
mysql-test/suite/rpl/r/rpl_myisam_null_values.result
+0
-24
mysql-test/suite/rpl/t/rpl_myisam_null_values.test
mysql-test/suite/rpl/t/rpl_myisam_null_values.test
+0
-53
sql/log_event.cc
sql/log_event.cc
+1
-38
sql/log_event_old.cc
sql/log_event_old.cc
+1
-38
No files found.
mysql-test/suite/rpl/r/rpl_myisam_null_values.result
deleted
100644 → 0
View file @
be2a015e
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 BIT, c2 INT);
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
Comparing tables master:test.t1 and slave:test.t1
DELETE FROM t1 WHERE c2=1 LIMIT 1;
Comparing tables master:test.t1 and slave:test.t1
DROP TABLE t1;
CREATE TABLE t1 (c1 CHAR);
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
# should trigger switch to row due to LIMIT
UPDATE t1 SET c1=NULL WHERE c1='w' LIMIT 2;
Comparing tables master:test.t1 and slave:test.t1
DELETE FROM t1 LIMIT 2;
Comparing tables master:test.t1 and slave:test.t1
DROP TABLE t1;
mysql-test/suite/rpl/t/rpl_myisam_null_values.test
deleted
100644 → 0
View file @
be2a015e
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on delete cant find record
# BUG#49482: RBR: Replication may break on deletes when MyISAM tables + char field are used
--
source
include
/
master
-
slave
.
inc
--
source
include
/
have_binlog_format_mixed_or_row
.
inc
--
connection
master
CREATE
TABLE
t1
(
c1
BIT
,
c2
INT
);
INSERT
INTO
`t1`
VALUES
(
1
,
1
);
UPDATE
t1
SET
c1
=
NULL
where
c2
=
1
;
--
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
DELETE
FROM
t1
WHERE
c2
=
1
LIMIT
1
;
--
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
--
connection
master
CREATE
TABLE
t1
(
c1
CHAR
);
INSERT
INTO
t1
(
c1
)
VALUES
(
'w'
)
;
SELECT
*
FROM
t1
;
--
echo
# should trigger switch to row due to LIMIT
UPDATE
t1
SET
c1
=
NULL
WHERE
c1
=
'w'
LIMIT
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
DELETE
FROM
t1
LIMIT
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 @
22cff392
...
...
@@ -8724,24 +8724,6 @@ static bool record_compare(TABLE *table)
}
}
/**
Check if we are using MyISAM.
If this is a myisam table, then we cannot do a memcmp
right away because some NULL fields can still contain
an old value in the row - they are not shown to the user
because the null bit is set, however, the contents are
not cleared. As such, plain memory comparison cannot be
assured to work. See: BUG#49482 and BUG#49481.
On top of this, we do not store field contents for null
fields in the binlog, so this is extra important when
comparing records fetched from binlog and from storage
engine.
*/
if
(
table
->
file
->
ht
->
db_type
==
DB_TYPE_MYISAM
)
goto
record_compare_field_by_field
;
if
(
table
->
s
->
blob_fields
+
table
->
s
->
varchar_fields
==
0
)
{
result
=
cmp_record
(
table
,
record
[
1
]);
...
...
@@ -8757,33 +8739,14 @@ static bool record_compare(TABLE *table)
goto
record_compare_exit
;
}
record_compare_field_by_field:
/* Compare updated fields */
for
(
Field
**
ptr
=
table
->
field
;
*
ptr
;
ptr
++
)
{
Field
*
f
=
*
ptr
;
/* if just one of the fields is null then there is no match */
if
((
f
->
is_null_in_record
(
table
->
record
[
0
]))
==
!
(
f
->
is_null_in_record
(
table
->
record
[
1
])))
if
((
*
ptr
)
->
cmp_binary_offset
(
table
->
s
->
rec_buff_length
))
{
result
=
TRUE
;
goto
record_compare_exit
;
}
/* if both fields are not null then we can compare */
if
(
!
(
f
->
is_null_in_record
(
table
->
record
[
0
]))
&&
!
(
f
->
is_null_in_record
(
table
->
record
[
1
])))
{
if
(
f
->
cmp_binary_offset
(
table
->
s
->
rec_buff_length
))
{
result
=
TRUE
;
goto
record_compare_exit
;
}
}
/* if both fields are null then there is a match. compare next field */
}
record_compare_exit:
...
...
sql/log_event_old.cc
View file @
22cff392
...
...
@@ -351,24 +351,6 @@ static bool record_compare(TABLE *table)
}
}
/**
Check if we are using MyISAM.
If this is a myisam table, then we cannot do a memcmp
right away because some NULL fields can still contain
an old value in the row - they are not shown to the user
because the null bit is set, however, the contents are
not cleared. As such, plain memory comparison cannot be
assured to work. See: BUG#49482 and BUG#49481.
On top of this, we do not store field contents for null
fields in the binlog, so this is extra important when
comparing records fetched from binlog and from storage
engine.
*/
if
(
table
->
file
->
ht
->
db_type
==
DB_TYPE_MYISAM
)
goto
record_compare_field_by_field
;
if
(
table
->
s
->
blob_fields
+
table
->
s
->
varchar_fields
==
0
)
{
result
=
cmp_record
(
table
,
record
[
1
]);
...
...
@@ -384,33 +366,14 @@ static bool record_compare(TABLE *table)
goto
record_compare_exit
;
}
record_compare_field_by_field:
/* Compare updated fields */
for
(
Field
**
ptr
=
table
->
field
;
*
ptr
;
ptr
++
)
{
Field
*
f
=
*
ptr
;
/* if just one of the fields is null then there is no match */
if
((
f
->
is_null_in_record
(
table
->
record
[
0
]))
==
!
(
f
->
is_null_in_record
(
table
->
record
[
1
])))
if
((
*
ptr
)
->
cmp_binary_offset
(
table
->
s
->
rec_buff_length
))
{
result
=
TRUE
;
goto
record_compare_exit
;
}
/* if both fields are not null then we can compare */
if
(
!
(
f
->
is_null_in_record
(
table
->
record
[
0
]))
&&
!
(
f
->
is_null_in_record
(
table
->
record
[
1
])))
{
if
(
f
->
cmp_binary_offset
(
table
->
s
->
rec_buff_length
))
{
result
=
TRUE
;
goto
record_compare_exit
;
}
}
/* if both fields are null then there is a match. compare next field */
}
record_compare_exit:
...
...
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