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
7e0f4a6f
Commit
7e0f4a6f
authored
Feb 05, 2008
by
mkindahl@dl145h.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
parents
ccd53222
a25028ef
Changes
19
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
269 additions
and
84 deletions
+269
-84
include/my_base.h
include/my_base.h
+3
-1
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+3
-3
mysql-test/suite/binlog/r/binlog_old_versions.result
mysql-test/suite/binlog/r/binlog_old_versions.result
+10
-0
mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001
...-test/suite/binlog/std_data/binlog_old_version_4_1.000001
+0
-0
mysql-test/suite/binlog/t/binlog_old_versions.test
mysql-test/suite/binlog/t/binlog_old_versions.test
+15
-0
mysql-test/suite/bugs/data/rpl_bug12691.dat
mysql-test/suite/bugs/data/rpl_bug12691.dat
+3
-0
mysql-test/suite/bugs/r/rpl_bug12691.result
mysql-test/suite/bugs/r/rpl_bug12691.result
+34
-0
mysql-test/suite/bugs/t/rpl_bug12691.test
mysql-test/suite/bugs/t/rpl_bug12691.test
+53
-0
mysql-test/suite/rpl/r/rpl_loaddata_map.result
mysql-test/suite/rpl/r/rpl_loaddata_map.result
+1
-1
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+8
-8
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+8
-8
mysql-test/suite/rpl/t/rpl_loaddata_map.test
mysql-test/suite/rpl/t/rpl_loaddata_map.test
+4
-3
sql/log_event.cc
sql/log_event.cc
+107
-34
sql/log_event.h
sql/log_event.h
+8
-6
sql/log_event_old.cc
sql/log_event_old.cc
+2
-2
sql/rpl_record.cc
sql/rpl_record.cc
+4
-12
sql/rpl_record.h
sql/rpl_record.h
+1
-2
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/sql_binlog.cc
sql/sql_binlog.cc
+3
-4
No files found.
include/my_base.h
View file @
7e0f4a6f
...
@@ -419,7 +419,9 @@ enum ha_base_keytype {
...
@@ -419,7 +419,9 @@ enum ha_base_keytype {
statement */
statement */
#define HA_ERR_CORRUPT_EVENT 171
/* The event was corrupt, leading to
#define HA_ERR_CORRUPT_EVENT 171
/* The event was corrupt, leading to
illegal data being read */
illegal data being read */
#define HA_ERR_LAST 171
/*Copy last error nr.*/
#define HA_ERR_ROWS_EVENT_APPLY 172
/* The event could not be processed
no other hanlder error happened */
#define HA_ERR_LAST 172
/*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
...
...
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
View file @
7e0f4a6f
...
@@ -46,7 +46,7 @@ ALTER TABLE t1_bit
...
@@ -46,7 +46,7 @@ ALTER TABLE t1_bit
ALTER
TABLE
t1_char
ADD
x
CHAR
(
20
)
DEFAULT
'Just a test'
;
ALTER
TABLE
t1_char
ADD
x
CHAR
(
20
)
DEFAULT
'Just a test'
;
# ... and add one non-nullable INT column last in table 't1_text'
# ... and add one non-nullable INT column last in table 't1_text'
# with no default,
# with no default,
ALTER
TABLE
t1_nodef
ADD
x
INT
NOT
NULL
;
ALTER
TABLE
t1_nodef
ADD
x
INT
NOT
NULL
,
ADD
y
INT
NOT
NULL
,
ADD
z
INT
NOT
NULL
;
# ... and remove the last column in t2
# ... and remove the last column in t2
ALTER
TABLE
t2
DROP
b
;
ALTER
TABLE
t2
DROP
b
;
# ... change the type of the single column in table 't4'
# ... change the type of the single column in table 't4'
...
@@ -222,8 +222,8 @@ sync_slave_with_master;
...
@@ -222,8 +222,8 @@ sync_slave_with_master;
--
echo
****
On
Slave
****
--
echo
****
On
Slave
****
connection
slave
;
connection
slave
;
INSERT
INTO
t1_nodef
VALUES
(
1
,
2
,
3
);
INSERT
INTO
t1_nodef
VALUES
(
1
,
2
,
3
,
4
,
5
);
INSERT
INTO
t1_nodef
VALUES
(
2
,
4
,
6
);
INSERT
INTO
t1_nodef
VALUES
(
2
,
4
,
6
,
8
,
10
);
--
echo
****
On
Master
****
--
echo
****
On
Master
****
connection
master
;
connection
master
;
...
...
mysql-test/suite/binlog/r/binlog_old_versions.result
View file @
7e0f4a6f
...
@@ -29,6 +29,16 @@ SELECT COUNT(*) FROM t3;
...
@@ -29,6 +29,16 @@ SELECT COUNT(*) FROM t3;
COUNT(*)
COUNT(*)
17920
17920
DROP TABLE t1, t2, t3;
DROP TABLE t1, t2, t3;
==== Read binlog from version 4.1 ====
SELECT * FROM t1 ORDER BY a;
a b
0 last_insert_id
4 four
190243 random
SELECT COUNT(*) FROM t3;
COUNT(*)
17920
DROP TABLE t1, t3;
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ====
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t1 ORDER BY a;
a b
a b
...
...
mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001
0 → 100644
View file @
7e0f4a6f
File added
mysql-test/suite/binlog/t/binlog_old_versions.test
View file @
7e0f4a6f
...
@@ -52,6 +52,21 @@ SELECT COUNT(*) FROM t3;
...
@@ -52,6 +52,21 @@ SELECT COUNT(*) FROM t3;
DROP
TABLE
t1
,
t2
,
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
====
Read
binlog
from
version
4.1
====
# In this version, neither row-based binlogging nor Xid events
# existed, so the binlog was generated without the "row-based tests"
# part and the "get xid event" part, and it does not create table t2.
# Read binlog.
--
exec
$MYSQL_BINLOG
suite
/
binlog
/
std_data
/
binlog_old_version_4_1
.
000001
|
$MYSQL
# Show result.
SELECT
*
FROM
t1
ORDER
BY
a
;
SELECT
COUNT
(
*
)
FROM
t3
;
# Reset.
DROP
TABLE
t1
,
t3
;
--
echo
====
Read
binlog
from
alcatel
tree
(
mysql
-
5.1
-
wl2325
-
5.0
-
drop6
)
====
--
echo
====
Read
binlog
from
alcatel
tree
(
mysql
-
5.1
-
wl2325
-
5.0
-
drop6
)
====
# In this version, it was not possible to switch between row-based and
# In this version, it was not possible to switch between row-based and
...
...
mysql-test/suite/bugs/data/rpl_bug12691.dat
0 → 100644
View file @
7e0f4a6f
a
b
c
mysql-test/suite/bugs/r/rpl_bug12691.result
0 → 100644
View file @
7e0f4a6f
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;
**** On Master ****
CREATE TABLE t1 (b CHAR(10));
**** On Slave ****
STOP SLAVE;
**** On Master ****
LOAD DATA INFILE FILENAME
SELECT COUNT(*) FROM t1;
COUNT(*)
3
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: #
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (b CHAR(10))
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE FILENAME ;file_id=#
**** On Slave ****
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
**** On Master ****
DROP TABLE t1;
mysql-test/suite/bugs/t/rpl_bug12691.test
0 → 100644
View file @
7e0f4a6f
# Bug#12691: Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER
# Date: 01/31/2008
# Added: Serge Kozlov <skozlov@mysql.com>
--
source
include
/
master
-
slave
.
inc
--
connection
master
--
source
include
/
have_binlog_format_mixed_or_statement
.
inc
--
echo
--
echo
****
On
Master
****
CREATE
TABLE
t1
(
b
CHAR
(
10
));
--
echo
--
echo
****
On
Slave
****
--
sync_slave_with_master
STOP
SLAVE
;
--
source
include
/
wait_for_slave_to_stop
.
inc
--
connection
master
--
echo
--
echo
****
On
Master
****
--
exec
cp
$MYSQL_TEST_DIR
/
suite
/
bugs
/
data
/
rpl_bug12691
.
dat
$MYSQLTEST_VARDIR
/
tmp
/
--
echo
LOAD
DATA
INFILE
FILENAME
--
disable_query_log
--
eval
LOAD
DATA
INFILE
'$MYSQLTEST_VARDIR/tmp/rpl_bug12691.dat'
INTO
TABLE
t1
FIELDS
TERMINATED
BY
'|'
--
enable_query_log
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
rpl_bug12691
.
dat
SELECT
COUNT
(
*
)
FROM
t1
;
--
replace_column
2
# 5 #
--
replace_regex
/
Server
ver
:
.+/
Server
ver
:
#/ /table_id: [0-9]+/table_id: #/ /COMMIT.+xid=[0-9]+.+/#/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /'.+'/FILENAME/
SHOW
BINLOG
EVENTS
;
--
save_master_pos
--
connection
slave
--
echo
--
echo
****
On
Slave
****
SET
GLOBAL
SQL_SLAVE_SKIP_COUNTER
=
1
;
START
SLAVE
;
--
source
include
/
wait_for_slave_to_start
.
inc
--
sync_with_master
SELECT
COUNT
(
*
)
FROM
t1
;
# Clean up
--
connection
master
--
echo
--
echo
****
On
Master
****
DROP
TABLE
t1
;
--
sync_slave_with_master
mysql-test/suite/rpl/r/rpl_loaddata_map.result
View file @
7e0f4a6f
...
@@ -12,7 +12,7 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
...
@@ -12,7 +12,7 @@ load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2;
select count(*) from t2 /* 5 000 */;
select count(*) from t2 /* 5 000 */;
count(*)
count(*)
5000
5000
show binlog events in 'master-bin.000002' from
106
;
show binlog events in 'master-bin.000002' from
<binlog_start>
;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 106 Query 1 # use `test`; create table t2 (id int not null primary key auto_increment)
master-bin.000002 106 Query 1 # use `test`; create table t2 (id int not null primary key auto_increment)
master-bin.000002 229 Begin_load_query 1 # ;file_id=#;block_len=8192
master-bin.000002 229 Begin_load_query 1 # ;file_id=#;block_len=8192
...
...
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
View file @
7e0f4a6f
...
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
...
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL;
ALTER TABLE t1_nodef ADD x INT NOT NULL
, ADD y INT NOT NULL, ADD z INT NOT NULL
;
ALTER TABLE t2 DROP b;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
...
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
...
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
SET SQL_LOG_BIN=1;
**** On Slave ****
**** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (1,2,3
,4,5
);
INSERT INTO t1_nodef VALUES (2,4,6);
INSERT INTO t1_nodef VALUES (2,4,6
,8,10
);
**** On Master ****
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
...
@@ -403,9 +403,9 @@ a b
...
@@ -403,9 +403,9 @@ a b
2 4
2 4
**** On Slave ****
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
a b x
a b x
y z
1 4 3
1 4 3
4 5
2 4 6
2 4 6
8 10
**** On Master ****
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
...
@@ -413,8 +413,8 @@ a b
...
@@ -413,8 +413,8 @@ a b
1 4
1 4
**** On Slave ****
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
a b x
a b x
y z
1 4 3
1 4 3
4 5
**** Cleanup ****
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
...
...
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
View file @
7e0f4a6f
...
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
...
@@ -26,7 +26,7 @@ ADD x BIT(3) DEFAULT b'011',
ADD y BIT(5) DEFAULT b'10101',
ADD y BIT(5) DEFAULT b'10101',
ADD z BIT(2) DEFAULT b'10';
ADD z BIT(2) DEFAULT b'10';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_char ADD x CHAR(20) DEFAULT 'Just a test';
ALTER TABLE t1_nodef ADD x INT NOT NULL;
ALTER TABLE t1_nodef ADD x INT NOT NULL
, ADD y INT NOT NULL, ADD z INT NOT NULL
;
ALTER TABLE t2 DROP b;
ALTER TABLE t2 DROP b;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t4 MODIFY a FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
ALTER TABLE t5 MODIFY b FLOAT;
...
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
...
@@ -393,8 +393,8 @@ INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
SET SQL_LOG_BIN=1;
**** On Slave ****
**** On Slave ****
INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (1,2,3
,4,5
);
INSERT INTO t1_nodef VALUES (2,4,6);
INSERT INTO t1_nodef VALUES (2,4,6
,8,10
);
**** On Master ****
**** On Master ****
UPDATE t1_nodef SET b=2*b WHERE a=1;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
...
@@ -403,9 +403,9 @@ a b
...
@@ -403,9 +403,9 @@ a b
2 4
2 4
**** On Slave ****
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
a b x
a b x
y z
1 4 3
1 4 3
4 5
2 4 6
2 4 6
8 10
**** On Master ****
**** On Master ****
DELETE FROM t1_nodef WHERE a=2;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
...
@@ -413,8 +413,8 @@ a b
...
@@ -413,8 +413,8 @@ a b
1 4
1 4
**** On Slave ****
**** On Slave ****
SELECT * FROM t1_nodef ORDER BY a;
SELECT * FROM t1_nodef ORDER BY a;
a b x
a b x
y z
1 4 3
1 4 3
4 5
**** Cleanup ****
**** Cleanup ****
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
...
...
mysql-test/suite/rpl/t/rpl_loaddata_map.test
View file @
7e0f4a6f
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
# BUG#33413 show binlog events fails if binlog has event size of close
# BUG#33413 show binlog events fails if binlog has event size of close
# to max_allowed_packet
# to max_allowed_packet
source
include
/
have_binlog_format_mixed_or_statement
.
inc
;
source
include
/
master
-
slave
.
inc
;
source
include
/
master
-
slave
.
inc
;
source
include
/
have_innodb
.
inc
;
source
include
/
have_innodb
.
inc
;
source
include
/
have_binlog_format_mixed_or_statement
.
inc
;
source
include
/
have_binlog_format_mixed_or_statement
.
inc
;
...
@@ -35,9 +36,9 @@ select count(*) from t2 /* 5 000 */;
...
@@ -35,9 +36,9 @@ select count(*) from t2 /* 5 000 */;
# the binglog will show fragmented Append_block events
# the binglog will show fragmented Append_block events
--
let
$binlog_start
=
106
--
let
$binlog_start
=
106
--
replace_column
5
#
--
replace_column
2
# 4 #
5 #
--
replace_regex
/
\
/
\
*
xid
=.*
\
*
\
//\/* XID *\// /file_id=[0-9]+/file_id=#/
--
replace_regex
/
\
/
\
*
xid
=.*
\
*
\
//\/* XID *\// /file_id=[0-9]+/file_id=#/
/block_len=[0-9]+/block_len=#/
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
--
replace_result
$MYSQLTEST_VARDIR
MYSQLTEST_VARDIR
$binlog_start
<
binlog_start
>
--
eval
show
binlog
events
in
'master-bin.000002'
from
$binlog_start
--
eval
show
binlog
events
in
'master-bin.000002'
from
$binlog_start
...
...
sql/log_event.cc
View file @
7e0f4a6f
...
@@ -99,12 +99,23 @@ static const char *HA_ERR(int i)
...
@@ -99,12 +99,23 @@ static const char *HA_ERR(int i)
case
HA_ERR_RECORD_IS_THE_SAME
:
return
"HA_ERR_RECORD_IS_THE_SAME"
;
case
HA_ERR_RECORD_IS_THE_SAME
:
return
"HA_ERR_RECORD_IS_THE_SAME"
;
case
HA_ERR_LOGGING_IMPOSSIBLE
:
return
"HA_ERR_LOGGING_IMPOSSIBLE"
;
case
HA_ERR_LOGGING_IMPOSSIBLE
:
return
"HA_ERR_LOGGING_IMPOSSIBLE"
;
case
HA_ERR_CORRUPT_EVENT
:
return
"HA_ERR_CORRUPT_EVENT"
;
case
HA_ERR_CORRUPT_EVENT
:
return
"HA_ERR_CORRUPT_EVENT"
;
case
HA_ERR_ROWS_EVENT_APPLY
:
return
"HA_ERR_ROWS_EVENT_APPLY"
;
}
}
return
0
;
return
0
;
}
}
/**
/**
macro to call from different branches of Rows_log_event::do_apply_event
Error reporting facility for Rows_log_event::do_apply_event
@param level error, warning or info
@param ha_error HA_ERR_ code
@param rli pointer to the active Relay_log_info instance
@param thd pointer to the slave thread's thd
@param table pointer to the event's table object
@param type the type of the event
@param log_name the master binlog file name
@param pos the master binlog file pos (the next after the event)
*/
*/
static
void
inline
slave_rows_error_report
(
enum
loglevel
level
,
int
ha_error
,
static
void
inline
slave_rows_error_report
(
enum
loglevel
level
,
int
ha_error
,
Relay_log_info
const
*
rli
,
THD
*
thd
,
Relay_log_info
const
*
rli
,
THD
*
thd
,
...
@@ -112,14 +123,27 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
...
@@ -112,14 +123,27 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
const
char
*
log_name
,
ulong
pos
)
const
char
*
log_name
,
ulong
pos
)
{
{
const
char
*
handler_error
=
HA_ERR
(
ha_error
);
const
char
*
handler_error
=
HA_ERR
(
ha_error
);
char
buff
[
MAX_SLAVE_ERRMSG
],
*
slider
;
const
char
*
buff_end
=
buff
+
sizeof
(
buff
);
uint
len
;
List_iterator_fast
<
MYSQL_ERROR
>
it
(
thd
->
warn_list
);
MYSQL_ERROR
*
err
;
buff
[
0
]
=
0
;
for
(
err
=
it
++
,
slider
=
buff
;
err
&&
slider
<
buff_end
-
1
;
slider
+=
len
,
err
=
it
++
)
{
len
=
my_snprintf
(
slider
,
buff_end
-
slider
,
" %s, Error_code: %d;"
,
err
->
msg
,
err
->
code
);
}
rli
->
report
(
level
,
thd
->
net
.
client_last_errno
,
rli
->
report
(
level
,
thd
->
net
.
client_last_errno
,
"Could not execute %s event on table %s.%s;"
"Could not execute %s event on table %s.%s;"
"%s
%s
handler error %s; "
"%s handler error %s; "
"the event's master log %s, end_log_pos %lu"
,
"the event's master log %s, end_log_pos %lu"
,
type
,
table
->
s
->
db
.
str
,
type
,
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
,
table
->
s
->
table_name
.
str
,
thd
->
net
.
client_last_error
[
0
]
!=
0
?
thd
->
net
.
client_last_error
:
""
,
buff
,
thd
->
net
.
client_last_error
[
0
]
!=
0
?
";"
:
""
,
handler_error
==
NULL
?
"<unknown>"
:
handler_error
,
handler_error
==
NULL
?
"<unknown>"
:
handler_error
,
log_name
,
pos
);
log_name
,
pos
);
}
}
...
@@ -212,9 +236,9 @@ uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation
...
@@ -212,9 +236,9 @@ uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation
*/
*/
#ifdef MYSQL_CLIENT
#ifdef MYSQL_CLIENT
static
void
pretty_print_str
(
IO_CACHE
*
cache
,
char
*
str
,
int
len
)
static
void
pretty_print_str
(
IO_CACHE
*
cache
,
c
onst
c
har
*
str
,
int
len
)
{
{
char
*
end
=
str
+
len
;
c
onst
c
har
*
end
=
str
+
len
;
my_b_printf
(
cache
,
"
\'
"
);
my_b_printf
(
cache
,
"
\'
"
);
while
(
str
<
end
)
while
(
str
<
end
)
{
{
...
@@ -277,9 +301,9 @@ inline int ignored_error_code(int err_code)
...
@@ -277,9 +301,9 @@ inline int ignored_error_code(int err_code)
*/
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
static
char
*
pretty_print_str
(
char
*
packet
,
char
*
str
,
int
len
)
static
char
*
pretty_print_str
(
char
*
packet
,
c
onst
c
har
*
str
,
int
len
)
{
{
char
*
end
=
str
+
len
;
c
onst
c
har
*
end
=
str
+
len
;
char
*
pos
=
packet
;
char
*
pos
=
packet
;
*
pos
++=
'\''
;
*
pos
++=
'\''
;
while
(
str
<
end
)
while
(
str
<
end
)
...
@@ -385,7 +409,7 @@ static void cleanup_load_tmpdir()
...
@@ -385,7 +409,7 @@ static void cleanup_load_tmpdir()
write_str()
write_str()
*/
*/
static
bool
write_str
(
IO_CACHE
*
file
,
char
*
str
,
uint
length
)
static
bool
write_str
(
IO_CACHE
*
file
,
c
onst
c
har
*
str
,
uint
length
)
{
{
uchar
tmp
[
1
];
uchar
tmp
[
1
];
tmp
[
0
]
=
(
uchar
)
length
;
tmp
[
0
]
=
(
uchar
)
length
;
...
@@ -2957,18 +2981,63 @@ Format_description_log_event(const char* buf,
...
@@ -2957,18 +2981,63 @@ Format_description_log_event(const char* buf,
If post_header_len is null, it means malloc failed, and is_valid
If post_header_len is null, it means malloc failed, and is_valid
will fail, so there is no need to do anything.
will fail, so there is no need to do anything.
The trees which have wrong event id's are:
The trees in which events have wrong id's are:
mysql-5.1-wl2325-5.0-drop6p13-alpha, mysql-5.1-wl2325-5.0-drop6,
mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd (`grep -C2
mysql-5.1-wl1012.old mysql-5.1-wl2325-5.0-drop6p13-alpha
BEGIN_LOAD_QUERY_EVENT /home/bk/ * /sql/log_event.h`). The
mysql-5.1-wl2325-5.0-drop6 mysql-5.1-wl2325-5.0
corresponding version (`grep mysql, configure.in` in those trees)
mysql-5.1-wl2325-no-dd
strings are 5.2.2-a_drop6p13-alpha, 5.2.2-a_drop6p13c,
5.1.5-a_drop5p20, 5.1.2-a_drop5p5.
(this was found by grepping for two lines in sequence where the
first matches "FORMAT_DESCRIPTION_EVENT," and the second matches
"TABLE_MAP_EVENT," in log_event.h in all trees)
In these trees, the following server_versions existed since
TABLE_MAP_EVENT was introduced:
5.1.1-a_drop5p3 5.1.1-a_drop5p4 5.1.1-alpha
5.1.2-a_drop5p10 5.1.2-a_drop5p11 5.1.2-a_drop5p12
5.1.2-a_drop5p13 5.1.2-a_drop5p14 5.1.2-a_drop5p15
5.1.2-a_drop5p16 5.1.2-a_drop5p16b 5.1.2-a_drop5p16c
5.1.2-a_drop5p17 5.1.2-a_drop5p4 5.1.2-a_drop5p5
5.1.2-a_drop5p6 5.1.2-a_drop5p7 5.1.2-a_drop5p8
5.1.2-a_drop5p9 5.1.3-a_drop5p17 5.1.3-a_drop5p17b
5.1.3-a_drop5p17c 5.1.4-a_drop5p18 5.1.4-a_drop5p19
5.1.4-a_drop5p20 5.1.4-a_drop6p0 5.1.4-a_drop6p1
5.1.4-a_drop6p2 5.1.5-a_drop5p20 5.2.0-a_drop6p3
5.2.0-a_drop6p4 5.2.0-a_drop6p5 5.2.0-a_drop6p6
5.2.1-a_drop6p10 5.2.1-a_drop6p11 5.2.1-a_drop6p12
5.2.1-a_drop6p6 5.2.1-a_drop6p7 5.2.1-a_drop6p8
5.2.2-a_drop6p13 5.2.2-a_drop6p13-alpha 5.2.2-a_drop6p13b
5.2.2-a_drop6p13c
(this was found by grepping for "mysql," in all historical
versions of configure.in in the trees listed above).
There are 5.1.1-alpha versions that use the new event id's, so we
do not test that version string. So replication from 5.1.1-alpha
with the other event id's to a new version does not work.
Moreover, we can safely ignore the part after drop[56]. This
allows us to simplify the big list above to the following regexes:
5\.1\.[1-5]-a_drop5.*
5\.1\.4-a_drop6.*
5\.2\.[0-2]-a_drop6.*
This is what we test for in the 'if' below.
*/
*/
if
(
post_header_len
&&
if
(
post_header_len
&&
(
strncmp
(
server_version
,
"5.1.2-a_drop5"
,
13
)
==
0
||
server_version
[
0
]
==
'5'
&&
server_version
[
1
]
==
'.'
&&
strncmp
(
server_version
,
"5.1.5-a_drop5"
,
13
)
==
0
||
server_version
[
3
]
==
'.'
&&
strncmp
(
server_version
,
"5.2.2-a_drop6"
,
13
)
==
0
))
strncmp
(
server_version
+
5
,
"-a_drop"
,
7
)
==
0
&&
((
server_version
[
2
]
==
'1'
&&
server_version
[
4
]
>=
'1'
&&
server_version
[
4
]
<=
'5'
&&
server_version
[
12
]
==
'5'
)
||
(
server_version
[
2
]
==
'1'
&&
server_version
[
4
]
==
'4'
&&
server_version
[
12
]
==
'6'
)
||
(
server_version
[
2
]
==
'2'
&&
server_version
[
4
]
>=
'0'
&&
server_version
[
4
]
<=
'2'
&&
server_version
[
12
]
==
'6'
)))
{
{
if
(
number_of_event_types
!=
22
)
if
(
number_of_event_types
!=
22
)
{
{
...
@@ -6026,7 +6095,8 @@ bool sql_ex_info::write_data(IO_CACHE* file)
...
@@ -6026,7 +6095,8 @@ bool sql_ex_info::write_data(IO_CACHE* file)
sql_ex_info::init()
sql_ex_info::init()
*/
*/
char
*
sql_ex_info
::
init
(
char
*
buf
,
char
*
buf_end
,
bool
use_new_format
)
const
char
*
sql_ex_info
::
init
(
const
char
*
buf
,
const
char
*
buf_end
,
bool
use_new_format
)
{
{
cached_new_format
=
use_new_format
;
cached_new_format
=
use_new_format
;
if
(
use_new_format
)
if
(
use_new_format
)
...
@@ -6039,12 +6109,11 @@ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format)
...
@@ -6039,12 +6109,11 @@ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format)
the case when we have old format because we will be reusing net buffer
the case when we have old format because we will be reusing net buffer
to read the actual file before we write out the Create_file event.
to read the actual file before we write out the Create_file event.
*/
*/
const
char
*
ptr
=
buf
;
if
(
read_str
(
&
buf
,
buf_end
,
&
field_term
,
&
field_term_len
)
||
if
(
read_str
(
&
ptr
,
buf_end
,
(
const
char
**
)
&
field_term
,
&
field_term_len
)
||
read_str
(
&
buf
,
buf_end
,
&
enclosed
,
&
enclosed_len
)
||
read_str
(
&
ptr
,
buf_end
,
(
const
char
**
)
&
enclosed
,
&
enclosed_len
)
||
read_str
(
&
buf
,
buf_end
,
&
line_term
,
&
line_term_len
)
||
read_str
(
&
ptr
,
buf_end
,
(
const
char
**
)
&
line_term
,
&
line_term_len
)
||
read_str
(
&
buf
,
buf_end
,
&
line_start
,
&
line_start_len
)
||
read_str
(
&
ptr
,
buf_end
,
(
const
char
**
)
&
line_start
,
&
line_start_len
)
||
read_str
(
&
buf
,
buf_end
,
&
escaped
,
&
escaped_len
))
read_str
(
&
ptr
,
buf_end
,
(
const
char
**
)
&
escaped
,
&
escaped_len
))
return
0
;
return
0
;
opt_flags
=
*
buf
++
;
opt_flags
=
*
buf
++
;
}
}
...
@@ -7646,7 +7715,7 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
...
@@ -7646,7 +7715,7 @@ Rows_log_event::write_row(const Relay_log_info *const rli,
/* fill table->record[0] with default values */
/* fill table->record[0] with default values */
if
((
error
=
prepare_record
(
rli
,
table
,
m_width
,
if
((
error
=
prepare_record
(
table
,
m_width
,
TRUE
/* check if columns have def. values */
)))
TRUE
/* check if columns have def. values */
)))
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
...
@@ -7964,12 +8033,16 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
...
@@ -7964,12 +8033,16 @@ int Rows_log_event::find_row(const Relay_log_info *rli)
DBUG_ASSERT
(
m_table
&&
m_table
->
in_use
!=
NULL
);
DBUG_ASSERT
(
m_table
&&
m_table
->
in_use
!=
NULL
);
TABLE
*
table
=
m_table
;
TABLE
*
table
=
m_table
;
int
error
;
int
error
=
0
;
/* unpack row - missing fields get default values */
/*
rpl_row_tabledefs.test specifies that
if the extra field on the slave does not have a default value
and this is okay with Delete or Update events.
Todo: fix wl3228 hld that requires defauls for all types of events
*/
// TODO: shall we check and report errors here?
prepare_record
(
table
,
m_width
,
FALSE
);
prepare_record
(
NULL
,
table
,
m_width
,
FALSE
/* don't check errors */
);
error
=
unpack_current_row
(
rli
);
error
=
unpack_current_row
(
rli
);
#ifndef DBUG_OFF
#ifndef DBUG_OFF
...
...
sql/log_event.h
View file @
7e0f4a6f
...
@@ -152,11 +152,11 @@ struct old_sql_ex
...
@@ -152,11 +152,11 @@ struct old_sql_ex
struct
sql_ex_info
struct
sql_ex_info
{
{
sql_ex_info
()
{}
/* Remove gcc warning */
sql_ex_info
()
{}
/* Remove gcc warning */
char
*
field_term
;
c
onst
c
har
*
field_term
;
char
*
enclosed
;
c
onst
c
har
*
enclosed
;
char
*
line_term
;
c
onst
c
har
*
line_term
;
char
*
line_start
;
c
onst
c
har
*
line_start
;
char
*
escaped
;
c
onst
c
har
*
escaped
;
int
cached_new_format
;
int
cached_new_format
;
uint8
field_term_len
,
enclosed_len
,
line_term_len
,
line_start_len
,
escaped_len
;
uint8
field_term_len
,
enclosed_len
,
line_term_len
,
line_start_len
,
escaped_len
;
char
opt_flags
;
char
opt_flags
;
...
@@ -171,7 +171,7 @@ struct sql_ex_info
...
@@ -171,7 +171,7 @@ struct sql_ex_info
line_start_len
+
escaped_len
+
6
:
7
);
line_start_len
+
escaped_len
+
6
:
7
);
}
}
bool
write_data
(
IO_CACHE
*
file
);
bool
write_data
(
IO_CACHE
*
file
);
c
har
*
init
(
char
*
buf
,
char
*
buf_end
,
bool
use_new_format
);
c
onst
char
*
init
(
const
char
*
buf
,
const
char
*
buf_end
,
bool
use_new_format
);
bool
new_format
()
bool
new_format
()
{
{
return
((
cached_new_format
!=
-
1
)
?
cached_new_format
:
return
((
cached_new_format
!=
-
1
)
?
cached_new_format
:
...
@@ -3131,6 +3131,8 @@ class Rows_log_event : public Log_event
...
@@ -3131,6 +3131,8 @@ class Rows_log_event : public Log_event
ASSERT_OR_RETURN_ERROR
(
m_curr_row
<
m_rows_end
,
HA_ERR_CORRUPT_EVENT
);
ASSERT_OR_RETURN_ERROR
(
m_curr_row
<
m_rows_end
,
HA_ERR_CORRUPT_EVENT
);
int
const
result
=
::
unpack_row
(
rli
,
m_table
,
m_width
,
m_curr_row
,
&
m_cols
,
int
const
result
=
::
unpack_row
(
rli
,
m_table
,
m_width
,
m_curr_row
,
&
m_cols
,
&
m_curr_row_end
,
&
m_master_reclength
);
&
m_curr_row_end
,
&
m_master_reclength
);
if
(
m_curr_row_end
>
m_rows_end
)
my_error
(
ER_SLAVE_CORRUPT_EVENT
,
MYF
(
0
));
ASSERT_OR_RETURN_ERROR
(
m_curr_row_end
<=
m_rows_end
,
HA_ERR_CORRUPT_EVENT
);
ASSERT_OR_RETURN_ERROR
(
m_curr_row_end
<=
m_rows_end
,
HA_ERR_CORRUPT_EVENT
);
return
result
;
return
result
;
}
}
...
...
sql/log_event_old.cc
View file @
7e0f4a6f
...
@@ -2078,7 +2078,7 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli,
...
@@ -2078,7 +2078,7 @@ Old_rows_log_event::write_row(const Relay_log_info *const rli,
/* fill table->record[0] with default values */
/* fill table->record[0] with default values */
if
((
error
=
prepare_record
(
rli
,
table
,
m_width
,
if
((
error
=
prepare_record
(
table
,
m_width
,
TRUE
/* check if columns have def. values */
)))
TRUE
/* check if columns have def. values */
)))
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
...
@@ -2289,7 +2289,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
...
@@ -2289,7 +2289,7 @@ int Old_rows_log_event::find_row(const Relay_log_info *rli)
/* unpack row - missing fields get default values */
/* unpack row - missing fields get default values */
// TODO: shall we check and report errors here?
// TODO: shall we check and report errors here?
prepare_record
(
NULL
,
table
,
m_width
,
FALSE
/* don't check errors */
);
prepare_record
(
table
,
m_width
,
FALSE
/* don't check errors */
);
error
=
unpack_current_row
(
rli
);
error
=
unpack_current_row
(
rli
);
#ifndef DBUG_OFF
#ifndef DBUG_OFF
...
...
sql/rpl_record.cc
View file @
7e0f4a6f
...
@@ -307,17 +307,15 @@ unpack_row(Relay_log_info const *rli,
...
@@ -307,17 +307,15 @@ unpack_row(Relay_log_info const *rli,
If @c check is true, fields are explicitly initialized only if they have
If @c check is true, fields are explicitly initialized only if they have
default value or can be NULL. Otherwise error is reported.
default value or can be NULL. Otherwise error is reported.
@param log Used to report errors.
@param table Table whose record[0] buffer is prepared.
@param table Table whose record[0] buffer is prepared.
@param skip Number of columns for which default value initialization
@param skip Number of columns for which default value initialization
should be skipped.
should be skipped.
@param check Indicates if errors should be checked when setting default
@param check Indicates if errors should be checked when setting default
values.
values.
@returns 0 on success
.
@returns 0 on success
or a handler level error code
*/
*/
int
prepare_record
(
const
Slave_reporting_capability
*
const
log
,
int
prepare_record
(
TABLE
*
const
table
,
TABLE
*
const
table
,
const
uint
skip
,
const
bool
check
)
const
uint
skip
,
const
bool
check
)
{
{
DBUG_ENTER
(
"prepare_record"
);
DBUG_ENTER
(
"prepare_record"
);
...
@@ -337,14 +335,8 @@ int prepare_record(const Slave_reporting_capability *const log,
...
@@ -337,14 +335,8 @@ int prepare_record(const Slave_reporting_capability *const log,
if
(
check
&&
((
f
->
flags
&
mask
)
==
mask
))
if
(
check
&&
((
f
->
flags
&
mask
)
==
mask
))
{
{
DBUG_ASSERT
(
log
);
my_error
(
ER_NO_DEFAULT_FOR_FIELD
,
MYF
(
0
),
f
->
field_name
);
error
=
ER_NO_DEFAULT_FOR_FIELD
;
error
=
HA_ERR_ROWS_EVENT_APPLY
;
log
->
report
(
ERROR_LEVEL
,
error
,
"Field `%s` of table `%s`.`%s` "
"has no default value and cannot be NULL"
,
f
->
field_name
,
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
);
my_error
(
error
,
MYF
(
0
),
f
->
field_name
);
}
}
else
else
f
->
set_default
();
f
->
set_default
();
...
...
sql/rpl_record.h
View file @
7e0f4a6f
...
@@ -30,8 +30,7 @@ int unpack_row(Relay_log_info const *rli,
...
@@ -30,8 +30,7 @@ int unpack_row(Relay_log_info const *rli,
uchar
const
**
const
row_end
,
ulong
*
const
master_reclength
);
uchar
const
**
const
row_end
,
ulong
*
const
master_reclength
);
// Fill table's record[0] with default values.
// Fill table's record[0] with default values.
int
prepare_record
(
const
Slave_reporting_capability
*
const
,
TABLE
*
const
,
int
prepare_record
(
TABLE
*
const
,
const
uint
=
0
,
const
bool
=
FALSE
);
const
uint
=
0
,
const
bool
=
FALSE
);
#endif
#endif
#endif
#endif
sql/share/errmsg.txt
View file @
7e0f4a6f
...
@@ -6119,3 +6119,5 @@ ER_SLAVE_AMBIGOUS_EXEC_MODE
...
@@ -6119,3 +6119,5 @@ ER_SLAVE_AMBIGOUS_EXEC_MODE
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement."
eng "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement."
ER_SLAVE_CORRUPT_EVENT
eng "Corrupted replication event was detected"
sql/sql_binlog.cc
View file @
7e0f4a6f
...
@@ -152,14 +152,13 @@ void mysql_client_binlog_statement(THD* thd)
...
@@ -152,14 +152,13 @@ void mysql_client_binlog_statement(THD* thd)
*/
*/
if
(
!
have_fd_event
)
if
(
!
have_fd_event
)
{
{
if
(
bufptr
[
EVENT_TYPE_OFFSET
]
==
FORMAT_DESCRIPTION_EVENT
)
int
type
=
bufptr
[
EVENT_TYPE_OFFSET
];
if
(
type
==
FORMAT_DESCRIPTION_EVENT
||
type
==
START_EVENT_V3
)
have_fd_event
=
TRUE
;
have_fd_event
=
TRUE
;
else
else
{
{
my_error
(
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
,
my_error
(
ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT
,
MYF
(
0
),
MYF
(
0
),
Log_event
::
get_type_str
((
Log_event_type
)
type
));
Log_event
::
get_type_str
(
(
Log_event_type
)
bufptr
[
EVENT_TYPE_OFFSET
]));
goto
end
;
goto
end
;
}
}
}
}
...
...
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