Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
# The two bugs below (BUG#25507 and BUG#26116) existed only in
# statement-based binlogging; we test that now they are fixed;
# we also test that mixed and row-based binlogging work too,
# for completeness.
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
connection master;
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
--disable_warnings
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
--enable_warnings
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
#
# BUG#25507 "multi-row insert delayed + auto increment causes
# duplicate key entries on slave";
# happened only in statement-based binlogging.
#
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
2007-08-08 17:56:15 +02:00
CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
let $query = "INSERT DELAYED INTO t1 VALUES (null, 'Dr. No'), (null, 'From Russia With Love'), (null, 'Goldfinger'), (null, 'Thunderball'), (null, 'You Only Live Twice')";
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";"
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
FLUSH TABLE t1; # another way to be sure INSERT DELAYED has inserted
SELECT COUNT(*) FROM t1;
# when bug existed slave failed below ("duplicate key" error at random INSERT)
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
sync_slave_with_master;
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
use mysqlslap;
SELECT COUNT(*) FROM t1;
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
#
# BUG#26116 "If multi-row INSERT DELAYED has errors,
# statement-based binlogging breaks";
# happened only in statement-based binlogging.
#
connection master;
truncate table t1;
# first scenario: duplicate on first row
insert delayed into t1 values(10, "my name");
2009-11-03 20:02:56 +01:00
flush table t1;
BUG#39934: Slave stops for engine that only support row-based logging
This is a post-push fix addressing review requests and
problems with extra warnings.
Problem 1: The sub-statement where an unsafe warning was detected was
printed as part of the warning. This was ok for statements that
were unsafe due to, e.g., calls to UUID(), but did not make
sense for statements that were unsafe because there was more than
one autoincrement column (unsafeness in this case comes from the
combination of several sub-statements).
Fix 1: Instead of printing the sub-statement, print an explanation
of why the statement is unsafe.
Problem 2:
When a recursive construct (i.e., stored proceure, stored
function, trigger, view, prepared statement) contained several
sub-statements, and at least one of them was unsafe, there would be
one unsafeness warning per sub-statement - even for safe
sub-statements.
Fix 2:
Ensure that each type of warning is printed at most once, by
remembering throughout the execution of the statement which types
of warnings have been printed.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
- Clarified comment per review request.
- Added checks for the number of warnings in each invocation.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Per review request, replaced @@session.binlog_format by
@@global.binlog_format, since INSERT DELAYED reads the global
variable. (In this test case, the two variables have the same
value, so the change is cosmetic.)
mysql-test/r/sp_trans.result:
updated result file
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_ps.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
updated result file
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result file. Note that duplicate warnings are now gone.
mysql-test/suite/binlog/t/binlog_unsafe.test:
- Added tests for: (1) a statement that is unsafe in many ways;
(2) a statement that is unsafe in the same way several times.
- Use -- style to invoke mysqltest commands.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
updated result file
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
updated result file
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
Per review request, added comment explaining what the test case
does (copied from rpl_stm_found_rows.test)
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
Clarified grammar in comment.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
Updated result file.
sql/item_create.cc:
Made set_stmt_unsafe take one parameter, describing the
type of unsafeness.
sql/sp_head.cc:
Added unsafe_flags field and made it hold all the unsafe flags.
sql/sp_head.h:
- Removed the BINLOG_ROW_BASED_IF_MIXED flag from m_flags.
Instead, we use the new unsafe_flags field to hold the
unsafeness state of the sp.
- Made propagate_attributes() copy all unsafe flags.
sql/sql_base.cc:
- Made LEX::set_stmt_unsafe() take an extra argument.
- Made binlog_unsafe_warning_flags store the type of unsafeness.
- Per review requests, clarified comments
- Added DBUG printouts
sql/sql_class.cc:
- Made warnings be generated in issue_warnings() and call that from
binlog_query(). Wrote issue_warnings(), which prints zero or more
warnings, avoiding to print warnings more than once per statement.
- Per review request, added @todo so that we remember to assert
correct behavior in binlog_query.
sql/sql_class.h:
- Removed BINLOG_WARNING_PRINTED
- Use [set|clear]_current_stmt_binlog_row_based() instead of
modifying the flag directly.
- added issue_unsafe_warnings() (only called from binlog_unsafe)
- Per review request, improved some documentation.
sql/sql_insert.cc:
Added extra argument to LEX::set_stmt_unsafe()
sql/sql_lex.h:
- Added enum_binlog_stmt_unsafe, listing all types of unsafe
statements.
- Per review requests, improved many comments for member
functions.
- Added [get|set]_stmt_unsafe_flags(), which return/set all the
unsafe flags for a statement.
sql/sql_parse.cc:
- Renamed binlog_warning_flags to binlog_unsafe_warning_flags.
- Per review requests, improved comment.
sql/sql_view.cc:
Made views propagate all the new unsafe flags.
sql/sql_yacc.yy:
Added parameter to set_stmt_unsafe().
storage/innobase/handler/ha_innodb.cc:
Per review requests, replaced DBUG_EXECUTE_IF() by DBUG_EVALUATE_IF().
2009-07-22 18:16:17 +02:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
{
# statement below will be converted to non-delayed INSERT and so
# will stop at first error, guaranteeing replication.
2007-06-06 19:57:07 +02:00
--error ER_DUP_ENTRY
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
}
BUG#39934: Slave stops for engine that only support row-based logging
This is a post-push fix addressing review requests and
problems with extra warnings.
Problem 1: The sub-statement where an unsafe warning was detected was
printed as part of the warning. This was ok for statements that
were unsafe due to, e.g., calls to UUID(), but did not make
sense for statements that were unsafe because there was more than
one autoincrement column (unsafeness in this case comes from the
combination of several sub-statements).
Fix 1: Instead of printing the sub-statement, print an explanation
of why the statement is unsafe.
Problem 2:
When a recursive construct (i.e., stored proceure, stored
function, trigger, view, prepared statement) contained several
sub-statements, and at least one of them was unsafe, there would be
one unsafeness warning per sub-statement - even for safe
sub-statements.
Fix 2:
Ensure that each type of warning is printed at most once, by
remembering throughout the execution of the statement which types
of warnings have been printed.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
- Clarified comment per review request.
- Added checks for the number of warnings in each invocation.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Per review request, replaced @@session.binlog_format by
@@global.binlog_format, since INSERT DELAYED reads the global
variable. (In this test case, the two variables have the same
value, so the change is cosmetic.)
mysql-test/r/sp_trans.result:
updated result file
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_ps.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
updated result file
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result file. Note that duplicate warnings are now gone.
mysql-test/suite/binlog/t/binlog_unsafe.test:
- Added tests for: (1) a statement that is unsafe in many ways;
(2) a statement that is unsafe in the same way several times.
- Use -- style to invoke mysqltest commands.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
updated result file
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
updated result file
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
Per review request, added comment explaining what the test case
does (copied from rpl_stm_found_rows.test)
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
Clarified grammar in comment.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
Updated result file.
sql/item_create.cc:
Made set_stmt_unsafe take one parameter, describing the
type of unsafeness.
sql/sp_head.cc:
Added unsafe_flags field and made it hold all the unsafe flags.
sql/sp_head.h:
- Removed the BINLOG_ROW_BASED_IF_MIXED flag from m_flags.
Instead, we use the new unsafe_flags field to hold the
unsafeness state of the sp.
- Made propagate_attributes() copy all unsafe flags.
sql/sql_base.cc:
- Made LEX::set_stmt_unsafe() take an extra argument.
- Made binlog_unsafe_warning_flags store the type of unsafeness.
- Per review requests, clarified comments
- Added DBUG printouts
sql/sql_class.cc:
- Made warnings be generated in issue_warnings() and call that from
binlog_query(). Wrote issue_warnings(), which prints zero or more
warnings, avoiding to print warnings more than once per statement.
- Per review request, added @todo so that we remember to assert
correct behavior in binlog_query.
sql/sql_class.h:
- Removed BINLOG_WARNING_PRINTED
- Use [set|clear]_current_stmt_binlog_row_based() instead of
modifying the flag directly.
- added issue_unsafe_warnings() (only called from binlog_unsafe)
- Per review request, improved some documentation.
sql/sql_insert.cc:
Added extra argument to LEX::set_stmt_unsafe()
sql/sql_lex.h:
- Added enum_binlog_stmt_unsafe, listing all types of unsafe
statements.
- Per review requests, improved many comments for member
functions.
- Added [get|set]_stmt_unsafe_flags(), which return/set all the
unsafe flags for a statement.
sql/sql_parse.cc:
- Renamed binlog_warning_flags to binlog_unsafe_warning_flags.
- Per review requests, improved comment.
sql/sql_view.cc:
Made views propagate all the new unsafe flags.
sql/sql_yacc.yy:
Added parameter to set_stmt_unsafe().
storage/innobase/handler/ha_innodb.cc:
Per review requests, replaced DBUG_EXECUTE_IF() by DBUG_EVALUATE_IF().
2009-07-22 18:16:17 +02:00
if (`SELECT @@global.binlog_format != 'STATEMENT'`)
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
{
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
}
2009-11-03 20:02:56 +01:00
flush table t1;
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
select * from t1;
sync_slave_with_master;
# when bug existed in statement-based binlogging, t1 on slave had
# different content from on master
select * from t1;
# second scenario: duplicate on second row
connection master;
delete from t1 where id!=10;
BUG#39934: Slave stops for engine that only support row-based logging
This is a post-push fix addressing review requests and
problems with extra warnings.
Problem 1: The sub-statement where an unsafe warning was detected was
printed as part of the warning. This was ok for statements that
were unsafe due to, e.g., calls to UUID(), but did not make
sense for statements that were unsafe because there was more than
one autoincrement column (unsafeness in this case comes from the
combination of several sub-statements).
Fix 1: Instead of printing the sub-statement, print an explanation
of why the statement is unsafe.
Problem 2:
When a recursive construct (i.e., stored proceure, stored
function, trigger, view, prepared statement) contained several
sub-statements, and at least one of them was unsafe, there would be
one unsafeness warning per sub-statement - even for safe
sub-statements.
Fix 2:
Ensure that each type of warning is printed at most once, by
remembering throughout the execution of the statement which types
of warnings have been printed.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
- Clarified comment per review request.
- Added checks for the number of warnings in each invocation.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Per review request, replaced @@session.binlog_format by
@@global.binlog_format, since INSERT DELAYED reads the global
variable. (In this test case, the two variables have the same
value, so the change is cosmetic.)
mysql-test/r/sp_trans.result:
updated result file
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_ps.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
updated result file
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result file. Note that duplicate warnings are now gone.
mysql-test/suite/binlog/t/binlog_unsafe.test:
- Added tests for: (1) a statement that is unsafe in many ways;
(2) a statement that is unsafe in the same way several times.
- Use -- style to invoke mysqltest commands.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
updated result file
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
updated result file
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
Per review request, added comment explaining what the test case
does (copied from rpl_stm_found_rows.test)
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
Clarified grammar in comment.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
Updated result file.
sql/item_create.cc:
Made set_stmt_unsafe take one parameter, describing the
type of unsafeness.
sql/sp_head.cc:
Added unsafe_flags field and made it hold all the unsafe flags.
sql/sp_head.h:
- Removed the BINLOG_ROW_BASED_IF_MIXED flag from m_flags.
Instead, we use the new unsafe_flags field to hold the
unsafeness state of the sp.
- Made propagate_attributes() copy all unsafe flags.
sql/sql_base.cc:
- Made LEX::set_stmt_unsafe() take an extra argument.
- Made binlog_unsafe_warning_flags store the type of unsafeness.
- Per review requests, clarified comments
- Added DBUG printouts
sql/sql_class.cc:
- Made warnings be generated in issue_warnings() and call that from
binlog_query(). Wrote issue_warnings(), which prints zero or more
warnings, avoiding to print warnings more than once per statement.
- Per review request, added @todo so that we remember to assert
correct behavior in binlog_query.
sql/sql_class.h:
- Removed BINLOG_WARNING_PRINTED
- Use [set|clear]_current_stmt_binlog_row_based() instead of
modifying the flag directly.
- added issue_unsafe_warnings() (only called from binlog_unsafe)
- Per review request, improved some documentation.
sql/sql_insert.cc:
Added extra argument to LEX::set_stmt_unsafe()
sql/sql_lex.h:
- Added enum_binlog_stmt_unsafe, listing all types of unsafe
statements.
- Per review requests, improved many comments for member
functions.
- Added [get|set]_stmt_unsafe_flags(), which return/set all the
unsafe flags for a statement.
sql/sql_parse.cc:
- Renamed binlog_warning_flags to binlog_unsafe_warning_flags.
- Per review requests, improved comment.
sql/sql_view.cc:
Made views propagate all the new unsafe flags.
sql/sql_yacc.yy:
Added parameter to set_stmt_unsafe().
storage/innobase/handler/ha_innodb.cc:
Per review requests, replaced DBUG_EXECUTE_IF() by DBUG_EVALUATE_IF().
2009-07-22 18:16:17 +02:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
{
# statement below will be converted to non-delayed INSERT and so
# will be binlogged with its ER_DUP_ENTRY error code, guaranteeing
# replication (slave will hit the same error code and so be fine).
2007-06-06 19:57:07 +02:00
--error ER_DUP_ENTRY
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
}
BUG#39934: Slave stops for engine that only support row-based logging
This is a post-push fix addressing review requests and
problems with extra warnings.
Problem 1: The sub-statement where an unsafe warning was detected was
printed as part of the warning. This was ok for statements that
were unsafe due to, e.g., calls to UUID(), but did not make
sense for statements that were unsafe because there was more than
one autoincrement column (unsafeness in this case comes from the
combination of several sub-statements).
Fix 1: Instead of printing the sub-statement, print an explanation
of why the statement is unsafe.
Problem 2:
When a recursive construct (i.e., stored proceure, stored
function, trigger, view, prepared statement) contained several
sub-statements, and at least one of them was unsafe, there would be
one unsafeness warning per sub-statement - even for safe
sub-statements.
Fix 2:
Ensure that each type of warning is printed at most once, by
remembering throughout the execution of the statement which types
of warnings have been printed.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
- Clarified comment per review request.
- Added checks for the number of warnings in each invocation.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Per review request, replaced @@session.binlog_format by
@@global.binlog_format, since INSERT DELAYED reads the global
variable. (In this test case, the two variables have the same
value, so the change is cosmetic.)
mysql-test/r/sp_trans.result:
updated result file
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_ps.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
updated result file
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result file. Note that duplicate warnings are now gone.
mysql-test/suite/binlog/t/binlog_unsafe.test:
- Added tests for: (1) a statement that is unsafe in many ways;
(2) a statement that is unsafe in the same way several times.
- Use -- style to invoke mysqltest commands.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
updated result file
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
updated result file
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
Per review request, added comment explaining what the test case
does (copied from rpl_stm_found_rows.test)
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
Clarified grammar in comment.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
Updated result file.
sql/item_create.cc:
Made set_stmt_unsafe take one parameter, describing the
type of unsafeness.
sql/sp_head.cc:
Added unsafe_flags field and made it hold all the unsafe flags.
sql/sp_head.h:
- Removed the BINLOG_ROW_BASED_IF_MIXED flag from m_flags.
Instead, we use the new unsafe_flags field to hold the
unsafeness state of the sp.
- Made propagate_attributes() copy all unsafe flags.
sql/sql_base.cc:
- Made LEX::set_stmt_unsafe() take an extra argument.
- Made binlog_unsafe_warning_flags store the type of unsafeness.
- Per review requests, clarified comments
- Added DBUG printouts
sql/sql_class.cc:
- Made warnings be generated in issue_warnings() and call that from
binlog_query(). Wrote issue_warnings(), which prints zero or more
warnings, avoiding to print warnings more than once per statement.
- Per review request, added @todo so that we remember to assert
correct behavior in binlog_query.
sql/sql_class.h:
- Removed BINLOG_WARNING_PRINTED
- Use [set|clear]_current_stmt_binlog_row_based() instead of
modifying the flag directly.
- added issue_unsafe_warnings() (only called from binlog_unsafe)
- Per review request, improved some documentation.
sql/sql_insert.cc:
Added extra argument to LEX::set_stmt_unsafe()
sql/sql_lex.h:
- Added enum_binlog_stmt_unsafe, listing all types of unsafe
statements.
- Per review requests, improved many comments for member
functions.
- Added [get|set]_stmt_unsafe_flags(), which return/set all the
unsafe flags for a statement.
sql/sql_parse.cc:
- Renamed binlog_warning_flags to binlog_unsafe_warning_flags.
- Per review requests, improved comment.
sql/sql_view.cc:
Made views propagate all the new unsafe flags.
sql/sql_yacc.yy:
Added parameter to set_stmt_unsafe().
storage/innobase/handler/ha_innodb.cc:
Per review requests, replaced DBUG_EXECUTE_IF() by DBUG_EVALUATE_IF().
2009-07-22 18:16:17 +02:00
if (`SELECT @@global.binlog_format != 'STATEMENT'`)
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
{
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
}
flush table t1; # to wait for INSERT DELAYED to be done
select * from t1;
sync_slave_with_master;
# when bug existed in statement-based binlogging, query was binlogged
# with error_code=0 so slave stopped
select * from t1;
# clean up
connection master;
Manual merge from 5.0-rpl, of fixes for:
1)
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: in statement-based binlogging, a multi-row INSERT
DELAYED is silently converted to a non-delayed INSERT.
This is supposed to not affect many 5.1 users as in 5.1, the default
binlog format is "mixed", which does not have the bug (the bug is
only with binlog_format=STATEMENT).
We should document how the system delayed_insert thread decides of
its binlog format (which is not modified by this patch):
this decision is taken when the thread is created
and holds until it is terminated (is not affected by any later change
via SET GLOBAL BINLOG_FORMAT). It is also not affected by the binlog
format of the connection which issues INSERT DELAYED (this binlog
format does not affect how the row will be binlogged).
If one wants to change the binlog format of its server with SET
GLOBAL BINLOG_FORMAT, it should do FLUSH TABLES to be sure all
delayed_insert threads terminate and thus new threads are created,
taking into account the new format.
2)
BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values".
When in an INSERT ON DUPLICATE KEY UPDATE, using
an autoincrement column, we inserted some autogenerated values and
also updated some rows, some autogenerated values were not used
(for example, even if 10 was the largest autoinc value in the table
at the start of the statement, 12 could be the first autogenerated
value inserted by the statement, instead of 11). One autogenerated
value was lost per updated row. Led to exhausting the range of the
autoincrement column faster.
Bug introduced by fix of BUG#20188; present since 5.0.24 and 5.1.12.
This bug breaks replication from a pre-5.0.24/pre-5.1.12 master.
But the present bugfix, as it makes INSERT ON DUP KEY UPDATE
behave like pre-5.0.24/pre-5.1.12, breaks replication from a
[5.0.24,5.0.34]/[5.1.12,5.1.15]
master to a fixed (5.0.36/5.1.16) slave! To warn users against this when
they upgrade their slave, as agreed with the support team, we add
code for a fixed slave to detect that it is connected to a buggy
master in a situation (INSERT ON DUP KEY UPDATE into autoinc column)
likely to break replication, in which case it cannot replicate so
stops and prints a message to the slave's error log and to SHOW SLAVE
STATUS.
For 5.0.36->[5.0.24,5.0.34] replication or 5.1.16->[5.1.12,5.1.15]
replication we cannot warn as master
does not know the slave's version (but we always recommended to users
to have slave at least as new as master).
As agreed with support, I have asked for an alert to be put into
the MySQL Network Monitoring and Advisory Service.
3) note that I'll re-enable rpl_insert_id as soon as 5.1-rpl gets
the changes from the main 5.1.
BitKeeper/deleted/.del-rpl_insert_delayed.result:
Delete: mysql-test/r/rpl_insert_delayed.result
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
tests for BUG#25507 (lauch many concurrent INSERT DELAYED into an auto_inc
column and see if they cause duplicates) and BUG#26116 (see if one error
at first row on master makes the slave's data incorrect).
It is then incorporated into a statement-based and mixed binlogging
test, and into a row-based test.
It is in fact mysql-test/t/rpl_insert_delayed.test from 5.0, renamed
and extended to test BUG#25507.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
manual merge of test for BUG#24432
"INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
from 5.0
mysql-test/r/rpl_insert_id.result:
result update (it automerged from 5.0, contrary to the test file)
mysql-test/r/rpl_known_bugs_detection.result:
result update (binlog event sizes differ from 5.0)
mysql-test/t/disabled.def:
rpl_insert_id tests statement-based replication of INSERT ON
DUPLICATE KEY UPDATE. This type of INSERT had BUG#24432, which is
fixed in 5.1.16; we made the slave detect if it is connected to a
<5.1.16 master and if so refuse to replicate.
The problem is that this 5.1-rpl tree, even though it will produce
the 5.1.16 release, still has a 5.1.15 version in configure.in.
Thus rpl_insert_id fails. So I disable it. As soon as the 5.1-rpl
tree gets the changesets from the main 5.1, its version will change
to 5.1.16 and so I'll be able to re-enable the test.
mysql-test/t/rpl_known_bugs_detection.test:
only in statement-based; row-based has no bug so test would fail.
sql/slave.cc:
slave_print_msg(ERROR_LEVEL) calls my_error(ER_UNKNOWN_ERROR);
so, for our my_printf_error(), which has a nicer message than this
my_error(), to have any effect, it must be
called before slave_print_msg()
sql/sql_insert.cc:
manual merge from 5.0 of a piece of the fixes for
BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values"
BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave"
BUG#26116 "If multi-row INSERT DELAYED has errors, statement-based
binlogging breaks".
The other pieces (e.g. log_event.cc) automerged from 5.0.
mysql-test/r/rpl_row_insert_delayed.result:
result
mysql-test/r/rpl_stm_insert_delayed.result:
result. Note how "mixed" and "statement" insert different data in
the table.
mysql-test/t/rpl_row_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in row-based mode
mysql-test/t/rpl_stm_insert_delayed.test:
wrapper to test INSERT DELAYED binlogging in statement-based and mixed
mode
2007-02-15 20:28:58 +01:00
USE test;
DROP SCHEMA mysqlslap;
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
sync_slave_with_master;
2007-07-27 13:28:36 +02:00
use test;
Fix for BUG#25507 "multi-row insert delayed + auto increment causes
duplicate key entries on slave" (two concurrrent connections doing
multi-row INSERT DELAYED to insert into an auto_increment column,
caused replication slave to stop with "duplicate key error" (and
binlog was wrong)), and BUG#26116 "If multi-row INSERT
DELAYED has errors, statement-based binlogging breaks" (the binlog
was not accounting for all rows inserted, or slave could stop).
The fix is that: if (statement-based) binlogging is on, a multi-row
INSERT DELAYED is silently converted to a non-delayed INSERT.
Note: it is not possible to test BUG#25507 in 5.0 (requires mysqlslap),
so it is tested only in the changeset for 5.1. However, BUG#26116
is tested here, and the fix for BUG#25507 is the same code change.
mysql-test/r/innodb-replace.result:
result update
mysql-test/t/innodb-replace.test:
now that multi-row delayed inserts are converted to normal inserts
if the statement-based binlog is enabled,
no error is issued even if this engine does not support INSERT DELAYED,
as the insert does not go through the INSERT DELAYED code.
To preserve the goal of this test, we change the statements to single-
row inserts.
sql/sql_insert.cc:
A multi-row INSERT DELAYED cannot be recorded to a statement-based
binlog in a way that describes the insertions actually done;
in that case we fallback to a non-delayed INSERT.
mysql-test/r/rpl_insert_delayed.result:
result. Master and slave match.
mysql-test/t/rpl_insert_delayed.test:
Test for BUG#26116 (see if one error at first row on master makes the
slave's data incorrect, see if one error at second row on master
makes slave stop).
2007-02-15 15:39:03 +01:00
connection master;
2007-07-26 10:31:10 +02:00
#
# Bug #29571: INSERT DELAYED IGNORE written to binary log on the master but
# on the slave
#
2010-05-26 16:34:25 +02:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
2007-07-27 16:29:48 +02:00
{
#flush the logs before the test
connection slave;
FLUSH LOGS;
2012-12-17 12:49:11 +01:00
source include/wait_for_binlog_checkpoint.inc;
2007-07-27 16:29:48 +02:00
connection master;
FLUSH LOGS;
2012-12-17 12:49:11 +01:00
source include/wait_for_binlog_checkpoint.inc;
2007-07-27 16:29:48 +02:00
}
2007-07-27 13:28:36 +02:00
2007-07-26 10:31:10 +02:00
CREATE TABLE t1(a int, UNIQUE(a));
2010-06-08 04:27:34 +02:00
--let $_start= query_get_value(SHOW MASTER STATUS, Position, 1)
2007-07-26 10:31:10 +02:00
INSERT DELAYED IGNORE INTO t1 VALUES(1);
2012-09-18 14:14:19 +02:00
--disable_warnings
2007-07-26 10:31:10 +02:00
INSERT DELAYED IGNORE INTO t1 VALUES(1);
2012-09-18 14:14:19 +02:00
--enable_warnings
2007-07-26 15:59:21 +02:00
flush table t1; # to wait for INSERT DELAYED to be done
2010-05-26 16:34:25 +02:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
2007-07-27 16:29:48 +02:00
{
#must show two INSERT DELAYED
Bug #49741 test files contain explicit references to bin/relay-log positions
Some of the test cases reference to binlog position and
these position numbers are written into result explicitly.
It is difficult to maintain if log event format changes.
There are a couple of cases explicit position number appears,
we handle them in different ways
A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options
Use --replace_result to mask them.
B. 'SHOW BINLOG EVENT ...'
Replaced by show_binlog_events.inc or wait_for_binlog_event.inc.
show_binlog_events.inc file's function is enhanced by given
$binlog_file and $binlog_limit.
C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc'
For the test cases just care a few items in the result of 'SHOW SLAVE STATUS',
only the items related to each test case are showed.
'show_slave_status.inc' is rebuild, only the given items in $status_items
will be showed.
'check_slave_is_running.inc' and 'check_slave_no_error.inc'
and 'check_slave_param.inc' are auxiliary files helping
to show running status and error information easily.
mysql-test/extra/binlog_tests/binlog.test:
It only cares whether current binlog file index is changed, so it is ok
with 'show_master_status.inc' instead of 'show mater status'.
mysql-test/extra/binlog_tests/blackhole.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_deadlock.test:
Use 'check_slave_is_running.inc' instead of 'show_slave_status2.inc'.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Use 'wait_for_slave_sql_error.inc' and 'ait_for_slave_sql_error_and_skip.inc' instead of 'show slave status'.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
It is need now to give a error number, so use 'wait_for_slave_io_to_stop.inc'
instead of 'wait_for_slave_io_error.inc'.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc' statement.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Use 'show_slave_error_status_and_skip.inc' instead of 'show slave status'.
mysql-test/include/check_slave_is_running.inc:
To make sure both sql and io thread are running well. If not, the test will be aborted.
mysql-test/include/check_slave_no_error.inc:
To make sure both sql and io thread have no error. If not, the test will be aborted.
mysql-test/include/get_relay_log_pos.inc:
According to the position of a log event in master binlog file,
find the peer position of a log event in relay log file.
mysql-test/include/rpl_stmt_seq.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/include/show_binlog_events.inc:
Add two options $binlog_file and $binlog_limit for showing binlog events from different binlog files or/and given different limits on position or row number.
mysql-test/include/show_rpl_debug_info.inc:
Add 'SELECT NOW()' in the debug information.
mysql-test/include/show_slave_status.inc:
It's more clean and tidy Only the given columns of slave status are printed.
mysql-test/include/test_fieldsize.inc:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/include/wait_for_binlog_event.inc:
Use show_rpl_debug_info.inc instead of 'SHOW BINLOG EVENTS'.
mysql-test/include/wait_for_slave_io_error.inc:
Add $slave_io_errno and $show_slave_io_error, it waits only a given error.
mysql-test/include/wait_for_slave_param.inc:
Use die instead of exit.
mysql-test/include/wait_for_slave_sql_error.inc:
Add $slave_sql_errno and $show_slave_sql_error, it waits only a given error.
mysql-test/include/wait_for_status_var.inc:
Use die instead of exit.
mysql-test/r/flush_block_commit_notembedded.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/r/multi_update.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_innodb.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/t/binlog_innodb.test:
It checks whether somethings are binlogged, so we use 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/t/binlog_stm_binlog.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/r/rpl_bug36391.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/bugs/t/rpl_bug12691.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/t/rpl_bug36391.test:
'show master status' is replaced by 'show_master_status.inc'.
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/engines/funcs/r/rpl_000015.result:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/engines/funcs/t/rpl_000015.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test:
Use 'query_vertical SHOW SLAVE STATUS' instead of 'show slave status'.
There is no status columns in the result file, for no slave exists on master's server.
mysql-test/suite/engines/funcs/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test:
We doesn't really need the statement.
mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test:
Just show Relay_Log_File, running status and error informations.
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_log_pos.test:
Mask the explicit positions in the result file.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
Mask the explicit binary log positions in the result file.
mysql-test/suite/engines/funcs/t/rpl_server_id1.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/suite/engines/funcs/t/rpl_server_id2.test:
It doesn't really need in this test.
mysql-test/suite/engines/funcs/t/rpl_slave_status.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/manual/t/rpl_replication_delay.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/parts/t/rpl_partition.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_000015.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_binlog_grant.test:
Use 'wait_for_binlog_event.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_bug33931.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/rpl/t/rpl_critical_errors.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Mask the explicit position numbers in result file.
It is restricted running on SBR, for it want to binlog 'set @a=1' statement.
mysql-test/suite/rpl/t/rpl_empty_master_crash.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
UUse 'check_slave_is_running.inc' and 'show_slave_status.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
mysql-test/suite/rpl/t/rpl_grant.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_incident.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_loaddata_fatal.test:
Use 'wait_for_slave_sql_error_and_skip.inc' to wait the given sql thread error happening and then skip the event. There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_log_pos.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_replicate_do.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_skip_error.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and mask the explicit position number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_sp.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_ssl.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_ssl1.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_stm_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Mask master_log_pos and master_log_file
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/alter_table-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/create-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/ctype_cp932_binlog_stm.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/flush_block_commit_notembedded.test:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/t/multi_update.test:
It checks whether somethings are binlogged,
so we using 'wait_binlog_event.inc' instead of 'show master status'.
mysql-test/t/sp_trans_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
2010-05-24 15:54:08 +02:00
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
2010-06-08 04:27:34 +02:00
# The first INSERT DELAYED
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 2)
--echo $stmt
# The second INSERT DELAYED statement is the 3 item if two INSERT DELAYED are
# handled together
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 3)
# The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are
# handled separately
2010-11-17 11:16:13 +01:00
if ($stmt == COMMIT)
2010-06-08 04:27:34 +02:00
{
--let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5)
}
--echo $stmt
2007-07-27 16:29:48 +02:00
}
2007-07-26 10:31:10 +02:00
select * from t1;
sync_slave_with_master;
echo On slave;
2010-05-26 16:34:25 +02:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
2007-07-27 16:29:48 +02:00
{
#must show two INSERT DELAYED
Bug #49741 test files contain explicit references to bin/relay-log positions
Some of the test cases reference to binlog position and
these position numbers are written into result explicitly.
It is difficult to maintain if log event format changes.
There are a couple of cases explicit position number appears,
we handle them in different ways
A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options
Use --replace_result to mask them.
B. 'SHOW BINLOG EVENT ...'
Replaced by show_binlog_events.inc or wait_for_binlog_event.inc.
show_binlog_events.inc file's function is enhanced by given
$binlog_file and $binlog_limit.
C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc'
For the test cases just care a few items in the result of 'SHOW SLAVE STATUS',
only the items related to each test case are showed.
'show_slave_status.inc' is rebuild, only the given items in $status_items
will be showed.
'check_slave_is_running.inc' and 'check_slave_no_error.inc'
and 'check_slave_param.inc' are auxiliary files helping
to show running status and error information easily.
mysql-test/extra/binlog_tests/binlog.test:
It only cares whether current binlog file index is changed, so it is ok
with 'show_master_status.inc' instead of 'show mater status'.
mysql-test/extra/binlog_tests/blackhole.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_deadlock.test:
Use 'check_slave_is_running.inc' instead of 'show_slave_status2.inc'.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Use 'wait_for_slave_sql_error.inc' and 'ait_for_slave_sql_error_and_skip.inc' instead of 'show slave status'.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
It is need now to give a error number, so use 'wait_for_slave_io_to_stop.inc'
instead of 'wait_for_slave_io_error.inc'.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc' statement.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Use 'show_slave_error_status_and_skip.inc' instead of 'show slave status'.
mysql-test/include/check_slave_is_running.inc:
To make sure both sql and io thread are running well. If not, the test will be aborted.
mysql-test/include/check_slave_no_error.inc:
To make sure both sql and io thread have no error. If not, the test will be aborted.
mysql-test/include/get_relay_log_pos.inc:
According to the position of a log event in master binlog file,
find the peer position of a log event in relay log file.
mysql-test/include/rpl_stmt_seq.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/include/show_binlog_events.inc:
Add two options $binlog_file and $binlog_limit for showing binlog events from different binlog files or/and given different limits on position or row number.
mysql-test/include/show_rpl_debug_info.inc:
Add 'SELECT NOW()' in the debug information.
mysql-test/include/show_slave_status.inc:
It's more clean and tidy Only the given columns of slave status are printed.
mysql-test/include/test_fieldsize.inc:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/include/wait_for_binlog_event.inc:
Use show_rpl_debug_info.inc instead of 'SHOW BINLOG EVENTS'.
mysql-test/include/wait_for_slave_io_error.inc:
Add $slave_io_errno and $show_slave_io_error, it waits only a given error.
mysql-test/include/wait_for_slave_param.inc:
Use die instead of exit.
mysql-test/include/wait_for_slave_sql_error.inc:
Add $slave_sql_errno and $show_slave_sql_error, it waits only a given error.
mysql-test/include/wait_for_status_var.inc:
Use die instead of exit.
mysql-test/r/flush_block_commit_notembedded.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/r/multi_update.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_innodb.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/t/binlog_innodb.test:
It checks whether somethings are binlogged, so we use 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/t/binlog_stm_binlog.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/r/rpl_bug36391.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/bugs/t/rpl_bug12691.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/t/rpl_bug36391.test:
'show master status' is replaced by 'show_master_status.inc'.
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/engines/funcs/r/rpl_000015.result:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/engines/funcs/t/rpl_000015.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test:
Use 'query_vertical SHOW SLAVE STATUS' instead of 'show slave status'.
There is no status columns in the result file, for no slave exists on master's server.
mysql-test/suite/engines/funcs/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test:
We doesn't really need the statement.
mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test:
Just show Relay_Log_File, running status and error informations.
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_log_pos.test:
Mask the explicit positions in the result file.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
Mask the explicit binary log positions in the result file.
mysql-test/suite/engines/funcs/t/rpl_server_id1.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/suite/engines/funcs/t/rpl_server_id2.test:
It doesn't really need in this test.
mysql-test/suite/engines/funcs/t/rpl_slave_status.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/manual/t/rpl_replication_delay.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/parts/t/rpl_partition.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_000015.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_binlog_grant.test:
Use 'wait_for_binlog_event.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_bug33931.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/rpl/t/rpl_critical_errors.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Mask the explicit position numbers in result file.
It is restricted running on SBR, for it want to binlog 'set @a=1' statement.
mysql-test/suite/rpl/t/rpl_empty_master_crash.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
UUse 'check_slave_is_running.inc' and 'show_slave_status.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
mysql-test/suite/rpl/t/rpl_grant.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_incident.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_loaddata_fatal.test:
Use 'wait_for_slave_sql_error_and_skip.inc' to wait the given sql thread error happening and then skip the event. There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_log_pos.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_replicate_do.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_skip_error.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and mask the explicit position number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_sp.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_ssl.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_ssl1.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_stm_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Mask master_log_pos and master_log_file
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/alter_table-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/create-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/ctype_cp932_binlog_stm.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/flush_block_commit_notembedded.test:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/t/multi_update.test:
It checks whether somethings are binlogged,
so we using 'wait_binlog_event.inc' instead of 'show master status'.
mysql-test/t/sp_trans_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
2010-05-24 15:54:08 +02:00
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
2013-03-26 10:35:34 +01:00
# The show_binlog_events.inc already skips format_description, gtid list, and
# one binlog checkpoint events. Skip three more, second binlog checkpoint,
# Gtid, and CREATE TABLE, so we start at the first DML event
--let $binlog_limit= 3,6
Bug #49741 test files contain explicit references to bin/relay-log positions
Some of the test cases reference to binlog position and
these position numbers are written into result explicitly.
It is difficult to maintain if log event format changes.
There are a couple of cases explicit position number appears,
we handle them in different ways
A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options
Use --replace_result to mask them.
B. 'SHOW BINLOG EVENT ...'
Replaced by show_binlog_events.inc or wait_for_binlog_event.inc.
show_binlog_events.inc file's function is enhanced by given
$binlog_file and $binlog_limit.
C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc'
For the test cases just care a few items in the result of 'SHOW SLAVE STATUS',
only the items related to each test case are showed.
'show_slave_status.inc' is rebuild, only the given items in $status_items
will be showed.
'check_slave_is_running.inc' and 'check_slave_no_error.inc'
and 'check_slave_param.inc' are auxiliary files helping
to show running status and error information easily.
mysql-test/extra/binlog_tests/binlog.test:
It only cares whether current binlog file index is changed, so it is ok
with 'show_master_status.inc' instead of 'show mater status'.
mysql-test/extra/binlog_tests/blackhole.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_deadlock.test:
Use 'check_slave_is_running.inc' instead of 'show_slave_status2.inc'.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Use 'wait_for_slave_sql_error.inc' and 'ait_for_slave_sql_error_and_skip.inc' instead of 'show slave status'.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
It is need now to give a error number, so use 'wait_for_slave_io_to_stop.inc'
instead of 'wait_for_slave_io_error.inc'.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc' statement.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Use 'show_slave_error_status_and_skip.inc' instead of 'show slave status'.
mysql-test/include/check_slave_is_running.inc:
To make sure both sql and io thread are running well. If not, the test will be aborted.
mysql-test/include/check_slave_no_error.inc:
To make sure both sql and io thread have no error. If not, the test will be aborted.
mysql-test/include/get_relay_log_pos.inc:
According to the position of a log event in master binlog file,
find the peer position of a log event in relay log file.
mysql-test/include/rpl_stmt_seq.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/include/show_binlog_events.inc:
Add two options $binlog_file and $binlog_limit for showing binlog events from different binlog files or/and given different limits on position or row number.
mysql-test/include/show_rpl_debug_info.inc:
Add 'SELECT NOW()' in the debug information.
mysql-test/include/show_slave_status.inc:
It's more clean and tidy Only the given columns of slave status are printed.
mysql-test/include/test_fieldsize.inc:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/include/wait_for_binlog_event.inc:
Use show_rpl_debug_info.inc instead of 'SHOW BINLOG EVENTS'.
mysql-test/include/wait_for_slave_io_error.inc:
Add $slave_io_errno and $show_slave_io_error, it waits only a given error.
mysql-test/include/wait_for_slave_param.inc:
Use die instead of exit.
mysql-test/include/wait_for_slave_sql_error.inc:
Add $slave_sql_errno and $show_slave_sql_error, it waits only a given error.
mysql-test/include/wait_for_status_var.inc:
Use die instead of exit.
mysql-test/r/flush_block_commit_notembedded.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/r/multi_update.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_innodb.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/t/binlog_innodb.test:
It checks whether somethings are binlogged, so we use 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/t/binlog_stm_binlog.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/r/rpl_bug36391.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/bugs/t/rpl_bug12691.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/t/rpl_bug36391.test:
'show master status' is replaced by 'show_master_status.inc'.
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/engines/funcs/r/rpl_000015.result:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/engines/funcs/t/rpl_000015.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test:
Use 'query_vertical SHOW SLAVE STATUS' instead of 'show slave status'.
There is no status columns in the result file, for no slave exists on master's server.
mysql-test/suite/engines/funcs/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test:
We doesn't really need the statement.
mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test:
Just show Relay_Log_File, running status and error informations.
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_log_pos.test:
Mask the explicit positions in the result file.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
Mask the explicit binary log positions in the result file.
mysql-test/suite/engines/funcs/t/rpl_server_id1.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/suite/engines/funcs/t/rpl_server_id2.test:
It doesn't really need in this test.
mysql-test/suite/engines/funcs/t/rpl_slave_status.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/manual/t/rpl_replication_delay.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/parts/t/rpl_partition.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_000015.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_binlog_grant.test:
Use 'wait_for_binlog_event.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_bug33931.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/rpl/t/rpl_critical_errors.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Mask the explicit position numbers in result file.
It is restricted running on SBR, for it want to binlog 'set @a=1' statement.
mysql-test/suite/rpl/t/rpl_empty_master_crash.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
UUse 'check_slave_is_running.inc' and 'show_slave_status.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
mysql-test/suite/rpl/t/rpl_grant.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_incident.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_loaddata_fatal.test:
Use 'wait_for_slave_sql_error_and_skip.inc' to wait the given sql thread error happening and then skip the event. There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_log_pos.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_replicate_do.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_skip_error.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and mask the explicit position number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_sp.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_ssl.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_ssl1.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_stm_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Mask master_log_pos and master_log_file
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/alter_table-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/create-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/ctype_cp932_binlog_stm.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/flush_block_commit_notembedded.test:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/t/multi_update.test:
It checks whether somethings are binlogged,
so we using 'wait_binlog_event.inc' instead of 'show master status'.
mysql-test/t/sp_trans_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
2010-05-24 15:54:08 +02:00
--source include/show_binlog_events.inc
2007-07-27 16:29:48 +02:00
}
2007-07-26 10:31:10 +02:00
select * from t1;
# clean up
connection master;
drop table t1;
sync_slave_with_master;
2012-02-06 22:55:17 +01:00
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
2007-07-27 16:29:48 +02:00
{
#flush the logs after the test
FLUSH LOGS;
connection master;
FLUSH LOGS;
}
2007-07-26 10:31:10 +02:00
connection master;
2007-07-27 13:28:36 +02:00
2007-07-26 10:31:10 +02:00
--echo End of 5.0 tests