Bug#49836 reports that the geometry type does not work
with WL#5151 applied.
The GEOMETRY type inherits the blob comparison function,
which read the pack length from the metadata. The GEOMETRY
type does not fill in the metadata with anything sensible,
so it is always zero, meaning that the pack length for the
source type is considered zero, rendering it always "smaller"
than the target type which has pack length 4 (without pointer).
This patch fixes the problem by defining
Field_geom::pack_length_from_metadata() to always use the
same as Field_geom::row_pack_length().
when replicating
The function create_virtual_tmp_table does not
set db_low_byte_first in the same way as
create_tmp_table does, causing copying from
the virtual table to a real table to get strange
values for SET types on big-endian machines.
mysql-test/extra/rpl_tests/type_conversions.test:
Adding tests for converting between different-sized sets.
sql/sql_select.cc:
Settng dh_low_byte_first for tables created
with create_virtual_tmp_table.
'LOAD DATA CONCURRENT [LOCAL] INFILE ...' statment only is binlogged as
'LOAD DATA [LOCAL] INFILE ...' in SBR and MBR. As a result, if replication is on,
queries on slaves will be blocked by the replication SQL thread.
This patch write code to write 'CONCURRENT' into the log event if 'CONCURRENT' option
is in the original statement in SBR and MBR.
Problem: The test was written before BUG#45827 was fixed.
The test contained code that assumed the wrong behavior,
pre-BUG#45827. Then, the fix for BUG#45827 was merged
from 5.1-rep+2 to 5.1-rep+3. Since the test case assumed
the wrong behavior, it failed. This should have been fixed
by making the test assume the correct behavior, but was
fixed by updating the result file to assert failure.
Fix 1: fix the test to assume correct behavior
(post-BUG#45827), update result file.
Fix 2: make test fail with 'die' instead of 'exit' when
wrong behavior is detected. Thus, the test cannot be
silenced with a wrong result file in case the behavior
will change again.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
Replaced 'exit' by 'die' to avoid similar
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result file.
mysql-test/suite/binlog/t/binlog_unsafe.test:
Since BUG#45827 is now fixed, we need to update the test case
in two places where it expects the wrong result because of
BUG#45827.
Row-based replication requires the types of columns on the
master and slave to be approximately the same (some safe
conversions between strings are allowed), but does not
allow safe conversions between fields of similar types such
as TINYINT and INT.
This patch implement type conversions between similar fields
on the master and slave.
The conversions are controlled using a new variable
SLAVE_TYPE_CONVERSIONS of type SET('ALL_LOSSY','ALL_NON_LOSSY').
Non-lossy conversions are any conversions that do not run the
risk of losing any information, while lossy conversions can
potentially truncate the value. The column definitions are
checked to decide if the conversion is acceptable.
If neither conversion is enabled, it is required that the
definitions of the columns are identical on master and slave.
Conversion is done by creating an internal conversion table,
unpacking the master data into it, and then copy the data to
the real table on the slave.
.bzrignore:
New files added
client/Makefile.am:
New files added
client/mysqlbinlog.cc:
Functions in rpl_utility.cc is now needed by mysqlbinlog.cc.
libmysqld/Makefile.am:
New files added
mysql-test/extra/rpl_tests/check_type.inc:
Test include file to check a single type conversion.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Switching to use INT instead of TEXT for column that should not have matching types.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Adding code to enable type conversions for BIT tests since InnoDB
cannot handle them properly due to incorrect information stored as
metadata.
mysql-test/extra/rpl_tests/type_conversions.test:
Test file to check a set of type conversions
with current settings of slave_type_conversions.
mysql-test/suite/rpl/t/rpl_typeconv.test:
Test file to test conversions from master to slave with
all possible values for slave_type_conversions.
The test also checks that the slave_type_conversions
variable works as expected.
sql/field.cc:
Changing definition of compatible_field_size to both check if
two field with identical base types are compatible and give an
order between them if they are compatible.
This only implement checking on the slave, so it will not affect
replication from an old master to a new slave.
sql/field.h:
Changing prototypes for functions:
- compatible_field_size()
- init_for_tmp_table()
- row_pack_length()
sql/log_event.cc:
Changing compability checks to build a conversion table if the fields
are compatible, but does not have the same base type.
sql/log_event_old.cc:
Changing compability checks to build a conversion table if the fields
are compatible, but does not have the same base type.
sql/mysql_priv.h:
Adding global option variable for SLAVE_TYPE_CONVERSIONS
sql/mysqld.cc:
Adding SLAVE_TYPE_CONVERSIONS global server variable.
sql/rpl_record.cc:
Changing unpack_row to use the conversion table if present.
sql/rpl_rli.h:
Removing function get_tabledef and replacing it with get_table_data().
This function retrieve data for table opened for replication, not just
table definition.
sql/rpl_utility.cc:
Function table_def::compatible_with is changed to compare table on master
and slave for compatibility and generate a conversions table if they are
compatible.
Computing real type of fields from metadata for ENUM and SET types.
Computing pack_length correctly for ENUM, SET, and BLOB types.
Adding optimization to not check compatibility if no
slave type conversions are enabled.
sql/rpl_utility.h:
Changing prototypes since implementation has changed.
Modifying table_def::type() to return real type instead of stored type.
sql/set_var.cc:
Adding SLAVE_TYPE_CONVERSIONS variable.
sql/set_var.h:
Adding SLAVE_TYPE_CONVERSIONS variable.
sql/share/errmsg.txt:
Adding error messages for slave type conversions.
sql/sql_class.h:
Adding SLAVE_TYPE_CONVERSIONS variable.
sql/sql_select.cc:
Correcting create_virtual_tmp_table() to compute null bit positions
correctly in the presence of bit fields.
escaped field names
When in mixed or statement mode, the master logs LOAD DATA
queries by resorting to an Execute_load_query_log_event. This
event does not contain the original query, but a rewritten
version of it, which includes the table field names. However, the
rewrite does not escape the field names. If these names match a
reserved keyword, then the slave will stop with a syntax error
when executing the event.
We fix this by escaping the fields names as it happens already
for the table name.
mysql-test/extra/rpl_tests/rpl_loaddata.test:
Added test case for the reported bug.
mysql-test/r/mysqlbinlog.result:
Changed result to support escaped field name.
mysql-test/suite/binlog/r/binlog_killed_simulate.result:
Changed result to support escaped field name.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Changed result to support escaped field name.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Changed result to support escaped field name.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Changed result to support escaped field name.
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
Changed result to support escaped field name.
mysql-test/suite/rpl/r/rpl_loaddata.result:
Added result for new test.
Changed show slave status positions which are now different because of
extra escape character in field names.
mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
Changed show slave status positions which are now different because of
extra escape character.
mysql-test/suite/rpl/r/rpl_loaddata_map.result:
Changed result to support escaped field name.
mysql-test/suite/rpl/r/rpl_stm_log.result:
Changed result to support escaped field name.
mysql-test/t/mysqlbinlog.test:
Changed positions which is now different because of extra escape
character in field names.
sql/sql_load.cc:
Appended escape characters before and after field names.
2617.31.12, 2617.31.15, 2617.31.15, 2617.31.16, 2617.43.1
- initial changeset that introduced the fix for
Bug#989 and follow up fixes for all test suite failures
introduced in the initial changeset.
------------------------------------------------------------
revno: 2617.31.1
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 4284-6.0
timestamp: Fri 2009-03-06 19:17:00 -0300
message:
Bug#989: If DROP TABLE while there's an active transaction, wrong binlog order
WL#4284: Transactional DDL locking
Currently the MySQL server does not keep metadata locks on
schema objects for the duration of a transaction, thus failing
to guarantee the integrity of the schema objects being used
during the transaction and to protect then from concurrent
DDL operations. This also poses a problem for replication as
a DDL operation might be replicated even thought there are
active transactions using the object being modified.
The solution is to defer the release of metadata locks until
a active transaction is either committed or rolled back. This
prevents other statements from modifying the table for the
entire duration of the transaction. This provides commitment
ordering for guaranteeing serializability across multiple
transactions.
- Incompatible change:
If MySQL's metadata locking system encounters a lock conflict,
the usual schema is to use the try and back-off technique to
avoid deadlocks -- this schema consists in releasing all locks
and trying to acquire them all in one go.
But in a transactional context this algorithm can't be utilized
as its not possible to release locks acquired during the course
of the transaction without breaking the transaction commitments.
To avoid deadlocks in this case, the ER_LOCK_DEADLOCK will be
returned if a lock conflict is encountered during a transaction.
Let's consider an example:
A transaction has two statements that modify table t1, then table
t2, and then commits. The first statement of the transaction will
acquire a shared metadata lock on table t1, and it will be kept
utill COMMIT to ensure serializability.
At the moment when the second statement attempts to acquire a
shared metadata lock on t2, a concurrent ALTER or DROP statement
might have locked t2 exclusively. The prescription of the current
locking protocol is that the acquirer of the shared lock backs off
-- gives up all his current locks and retries. This implies that
the entire multi-statement transaction has to be rolled back.
- Incompatible change:
FLUSH commands such as FLUSH PRIVILEGES and FLUSH TABLES WITH READ
LOCK won't cause locked tables to be implicitly unlocked anymore.
mysql-test/extra/binlog_tests/drop_table.test:
Add test case for Bug#989.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction.
mysql-test/include/mix1.inc:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction.
mysql-test/include/mix2.inc:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction.
mysql-test/r/flush_block_commit.result:
Update test case result (WL#4284).
mysql-test/r/flush_block_commit_notembedded.result:
Update test case result (WL#4284).
mysql-test/r/innodb.result:
Update test case result (WL#4284).
mysql-test/r/innodb_mysql.result:
Update test case result (WL#4284).
mysql-test/r/lock.result:
Add test case result for an effect of WL#4284/Bug#989
(all locks should be released when a connection terminates).
mysql-test/r/mix2_myisam.result:
Update test case result (effects of WL#4284/Bug#989).
mysql-test/r/not_embedded_server.result:
Update test case result (effects of WL#4284/Bug#989).
Add a test case for interaction of WL#4284 and FLUSH PRIVILEGES.
mysql-test/r/partition_innodb_semi_consistent.result:
Update test case result (effects of WL#4284/Bug#989).
mysql-test/r/partition_sync.result:
Temporarily disable the test case for Bug#43867,
which will be fixed by a subsequent backport.
mysql-test/r/ps.result:
Add a test case for effect of PREPARE on transactional
locks: we take a savepoint at beginning of PREAPRE
and release it at the end. Thus PREPARE does not
accumulate metadata locks (Bug#989/WL#4284).
mysql-test/r/read_only_innodb.result:
Update test case result (effects of WL#4284/Bug#989).
mysql-test/suite/binlog/r/binlog_row_drop_tbl.result:
Add a test case result (WL#4284/Bug#989).
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Update test case result (effects of WL#4284/Bug#989).
mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result:
Add a test case result (WL#4284/Bug#989).
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Update test case result (effects of WL#4284/Bug#989).
mysql-test/suite/binlog/r/binlog_unsafe.result:
A side effect of Bug#989 -- slightly different table map ids.
mysql-test/suite/binlog/t/binlog_row_drop_tbl.test:
Add a test case for WL#4284/Bug#989.
mysql-test/suite/binlog/t/binlog_stm_drop_tbl.test:
Add a test case for WL#4284/Bug#989.
mysql-test/suite/binlog/t/binlog_stm_row.test:
Update to the new state name. This
is actually a follow up to another patch for WL#4284,
that changes Locked thread state to Table lock.
mysql-test/suite/ndb/r/ndb_index_ordered.result:
Remove result for disabled part of the test case.
mysql-test/suite/ndb/t/disabled.def:
Temporarily disable a test case (Bug#45621).
mysql-test/suite/ndb/t/ndb_index_ordered.test:
Disable a part of a test case (needs update to
reflect semantics of Bug#989).
mysql-test/suite/rpl/t/disabled.def:
Disable tests made meaningless by transactional metadata
locking.
mysql-test/suite/sys_vars/r/autocommit_func.result:
Add a commit (Bug#989).
mysql-test/suite/sys_vars/t/autocommit_func.test:
Add a commit (Bug#989).
mysql-test/t/flush_block_commit.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction.
mysql-test/t/flush_block_commit_notembedded.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction.
Add a test case for transaction-scope locks and the global
read lock (Bug#989/WL#4284).
mysql-test/t/innodb.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction
(effects of Bug#989/WL#4284).
mysql-test/t/lock.test:
Add a test case for Bug#989/WL#4284.
mysql-test/t/not_embedded_server.test:
Add a test case for Bug#989/WL#4284.
mysql-test/t/partition_innodb_semi_consistent.test:
Replace TRUNCATE with DELETE, to not issue
an implicit commit of a transaction, and not depend
on metadata locks.
mysql-test/t/partition_sync.test:
Temporarily disable the test case for Bug#43867,
which needs a fix to be backported from 6.0.
mysql-test/t/ps.test:
Add a test case for semantics of PREPARE and transaction-scope
locks: metadata locks on tables used in PREPARE are enclosed into a
temporary savepoint, taken at the beginning of PREPARE,
and released at the end. Thus PREPARE does not effect
what locks a transaction owns.
mysql-test/t/read_only_innodb.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction
(Bug#989/WL#4284).
Wait for the read_only statement to actually flush tables before
sending other concurrent statements that depend on its state.
mysql-test/t/xa.test:
Fix test case to reflect the fact that transactions now hold
metadata locks for the duration of a transaction
(Bug#989/WL#4284).
sql/ha_ndbcluster_binlog.cc:
Backport bits of changes of ha_ndbcluster_binlog.cc
from 6.0, to fix the failing binlog test suite with
WL#4284. WL#4284 implementation does not work
with 5.1 implementation of ndbcluster binlog index.
sql/log_event.cc:
Release metadata locks after issuing a commit.
sql/mdl.cc:
Style changes (WL#4284).
sql/mysql_priv.h:
Rename parameter to match the name used in the definition (WL#4284).
sql/rpl_injector.cc:
Release metadata locks on commit (WL#4284).
sql/rpl_rli.cc:
Remove assert made meaningless, metadata locks are released
at the end of the transaction.
sql/set_var.cc:
Close tables and release locks if autocommit mode is set.
sql/slave.cc:
Release metadata locks after a rollback.
sql/sql_acl.cc:
Don't implicitly unlock locked tables. Issue a implicit commit
at the end and unlock tables.
sql/sql_base.cc:
Defer the release of metadata locks when closing tables
if not required to.
Issue a deadlock error if the locking protocol requires
that a transaction re-acquire its locks.
Release metadata locks when closing tables for reopen.
sql/sql_class.cc:
Release metadata locks if the thread is killed.
sql/sql_parse.cc:
Release metadata locks after implicitly committing a active
transaction, or after explicit commits or rollbacks.
sql/sql_plugin.cc:
Allocate MDL request on the stack as the use of the table
is contained within the function. It will be removed from
the context once close_thread_tables is called at the end
of the function.
sql/sql_prepare.cc:
The problem is that the prepare phase of the CREATE TABLE
statement takes a exclusive metadata lock lock and this can
cause a self-deadlock the thread already holds a shared lock
on the table being that should be created.
The solution is to make the prepare phase take a shared
metadata lock when preparing a CREATE TABLE statement. The
execution of the statement will still acquire a exclusive
lock, but won't cause any problem as it issues a implicit
commit.
After some discussions with stakeholders it has been decided that
metadata locks acquired during a PREPARE statement must be released
once the statement is prepared even if it is prepared within a multi
statement transaction.
sql/sql_servers.cc:
Don't implicitly unlock locked tables. Issue a implicit commit
at the end and unlock tables.
sql/sql_table.cc:
Close table and release metadata locks after a admin operation.
sql/table.h:
The problem is that the prepare phase of the CREATE TABLE
statement takes a exclusive metadata lock lock and this can
cause a self-deadlock the thread already holds a shared lock
on the table being that should be created.
The solution is to make the prepare phase take a shared
metadata lock when preparing a CREATE TABLE statement. The
execution of the statement will still acquire a exclusive
lock, but won't cause any problem as it issues a implicit
commit.
sql/transaction.cc:
Release metadata locks after the implicitly committed due
to a new transaction being started. Also, release metadata
locks acquired after a savepoint if the transaction is rolled
back to the save point.
The problem is that in some cases transaction-long metadata locks
could be released before the transaction was committed. This could
happen when a active transaction was ended by a "START TRANSACTION"
or "BEGIN" statement, in which case the metadata locks would be
released before the actual commit of the active transaction.
The solution is to defer the release of metadata locks to after the
transaction has been implicitly committed. No test case is provided
as the effort to provide one is too disproportional to the size of
the fix.
Problem: Some system functions that could return different values on
master and slave were not marked unsafe. In particular:
GET_LOCK
IS_FREE_LOCK
IS_USED_LOCK
MASTER_POS_WAIT
RELEASE_LOCK
SLEEP
SYSDATE
VERSION
Fix: Mark these functions unsafe.
mysql-test/extra/rpl_tests/rpl_stm_000001.test:
- The test does not work in mixed mode any more, since it tries to
simulate an error in the sql thread in a query that uses get_lock.
Since get_lock now causes the query to be logged in row format,
the error didn't happen. Hence, we now force statement mode.
- Warnings must be disabled when the unsafe query is issued.
- Replaced some save_master_pos+connection slave+sync_with_master
by sync_slave_with_master.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
updated result file
mysql-test/suite/binlog/r/binlog_stm_row.result:
updated result file
mysql-test/suite/binlog/r/binlog_unsafe.result:
updated result file
mysql-test/suite/binlog/t/binlog_killed.test:
binlog_killed only works in statement format now, since
it switches to row mode in mixed mode.
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
suppress warnings for unsafe statements
mysql-test/suite/binlog/t/binlog_stm_row.test:
- Suppress warnings in test that causes warnings.
- The test sets binlog format explicitly, so no need to execute it
twice.
mysql-test/suite/binlog/t/binlog_unsafe.test:
Added test for all unsafe system functions. This test also includes
system functions that were unsafe prior to BUG#47995.
mysql-test/suite/rpl/r/rpl_err_ignoredtable.result:
updated result file
mysql-test/suite/rpl/r/rpl_get_lock.result:
updated result file
mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result:
new result file
mysql-test/suite/rpl/r/rpl_stm_000001.result:
updated result file
mysql-test/suite/rpl/r/rpl_trigger.result:
updated result file
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
- suppress warnings for unsafe statement
- replaced save_master_pos+connection slave+sync_with_master
with sync_slave_with_master
mysql-test/suite/rpl/t/rpl_get_lock.test:
update test case that causes new warnings
mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test:
Added new test case for nondeterministic functions.
mysql-test/suite/rpl/t/rpl_trigger.test:
update test case that causes new warnings
sql/item_create.cc:
Marked some system functions unsafe.
sql/item_strfunc.cc:
Clarified comment related to this bug.
sql/sql_yacc.yy:
Marked sysdate unsafe.
One statement that have more than one different tables to update with
autoinc columns just was marked as unsafe in mixed mode, so the unsafe
warning can't be produced in statement mode.
To fix the problem, mark the statement as unsafe in statement mode too.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
The test case is updated due to the patch of bug#45827.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
The test result is updated due to the patch of bug#45827.
mysql-test/suite/binlog/r/binlog_unsafe.result:
Test result for bug#45827.
mysql-test/suite/binlog/t/binlog_unsafe.test:
Added test to verify if stmt that have more than one
different tables to update with autoinc columns will
produce unsafe warning
mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result:
The test result is updated due to the patch of bug#45827.
mysql-test/suite/rpl/t/rpl_trigger.test:
The test case is updated due to the patch of bug#45827.
mysql-test/suite/rpl/t/rpl_variables_stm.test:
The test case is updated due to the patch of bug#45827.
sql/sql_base.cc:
Reomved the 'set_current_stmt_binlog_row_based_if_mixed' function
for producing unsafe warnings by executing 'decide_logging_format'
function later in statement mode
Create a set of test cases to see if some DDL statements implicitly commit
a transaction on the NDB and are written directly to the binary log without
going through either the Statement- or Transactional-Cache.
mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test:
Merged the test case into rpl_mixing_engines.test.
mysql-test/extra/rpl_tests/rpl_mixing_engines.inc:
Incorporated some tests from binlog_failure_mixing_engines.test and
fixed after BUG#47323.
mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
Incorporated some tests from binlog_failure_mixing_engines.test and
fixed after BUG#47323.
mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result:
Merged the test case into rpl_mixing_engines.test.
mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result:
Merged the test case into rpl_mixing_engines.test.
mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test:
Merged the test case into rpl_mixing_engines.test.
mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test:
Merged the test case into rpl_mixing_engines.test.
mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result:
Incorporated some tests from binlog_failure_mixing_engines.test and
changed after BUG#47323.
mysql-test/suite/rpl/r/rpl_row_mixing_engines.result:
Incorporated some tests from binlog_failure_mixing_engines.test and
changed after BUG#47323.
mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result:
Incorporated some tests from binlog_failure_mixing_engines.test and
changed after BUG#47323.
mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/r/rpl_mysql_upgrade.result:
Suppressed warning messages due to unsafe statements.
mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/t/rpl_mysql_upgrade.test:
Suppressed warning messages due to unsafe statements.
mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test:
Re-enabled some parts of the test after BUG#46572
mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test:
Re-enabled some parts of the test after BUG#46572
Non-transactional updates that take place inside a transaction present problems
for logging because they are visible to other clients before the transaction
is committed, and they are not rolled back even if the transaction is rolled
back. It is not always possible to log correctly in statement format when both
transactional and non-transactional tables are used in the same transaction.
In the current patch, we ensure that such scenario is completely safe under the
ROW and MIXED modes.
For application compatibility reasons MySQL converts "<autoincrement_column> IS NULL"
predicates to "<autoincrement_column> = LAST_INSERT_ID()" in the first SELECT following an
INSERT regardless of whether they're top level predicates or not. This causes wrong and
obscure results when these predicates are combined with others on the same columns. Fixed
by only doing the transformation on a single top-level predicate if a special SQL mode is
turned on (sql_auto_is_null).
Also made sql_auto_is_null off by default.
per-file comments:
mysql-test/r/func_isnull.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
test result updated
mysql-test/t/func_isnull.test
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
test case added
sql/mysqld.cc
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
sql_auto_is_null now is OFF by default.
sql/sql_select.cc
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
remove_eq_conds() split in two parts - one only checks the upper condition,
the req_remove_eq_conds() recursively checks all the condition tree.
mysql-test/extra/rpl_tests/rpl_insert_id.test
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
test fixed (set the sql_auto_is_null variable)
mysql-test/r/mysqlbinlog.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/r/mysqlbinlog2.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/r/odbc.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/r/query_cache.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/r/user_var-binlog.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/suite/rpl/r/rpl_insert_id.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/suite/rpl/r/rpl_sp.result
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
result updated
mysql-test/t/odbc.test
Bug#41371 Select returns 1 row with condition "col is not null and col is null"
test fixed (set the sql_auto_is_null variable)
binlog, replication aborts
In SBR or MBR, the schema name is not being written to the binlog
when executing a LOAD DATA statement. This becomes a problem when
the current database (lets call it db1) is different from the
table's schema (lets call it db2). For instance, take the
following statements:
use db1;
load data local infile 'infile.txt' into table db2.t
Should this statement be logged without t's schema (db2), when
replaying it, one can get db1.t populated instead of db2.t (if
db1.t exists). On the other hand, if there is no db1.t at all,
replication will stop.
We fix this by always logging the table (in load file) with fully
qualified name when its schema is different from the current
database or when no default database was selected.
Conflicts
=========
Text conflict in .bzr-mysql/default.conf
Text conflict in libmysqld/CMakeLists.txt
Text conflict in libmysqld/Makefile.am
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
Text conflict in mysql-test/t/mysqlbinlog.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/Makefile.am
Text conflict in sql/log_event_old.cc
Text conflict in sql/rpl_rli.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_binlog.cc
Text conflict in sql/sql_lex.h
21 conflicts encountered.
NOTE
====
mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr:
- "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr"
This is the first cset (merge/...) committed after pulling
from mysql-next-mr.
Backporting BUG#43789 to mysql-5.1-bugteam
The replication was generating corrupted data, warning messages on Valgrind
and aborting on debug mode while replicating a "null" to "not null" field.
Specifically the unpack_row routine, was considering the slave's table
definition and trying to retrieve a field value, where there was nothing to be
retrieved, ignoring the fact that the value was defined as "null" by the master.
To fix the problem, we proceed as follows:
1 - If it is not STRICT sql_mode, implicit default values are used, regardless
if it is multi-row or single-row statement.
2 - However, if it is STRICT mode, then a we do what follows:
2.1 If it is a transactional engine, we do a rollback on the first NULL that is
to be set into a NOT NULL column and return an error.
2.2 If it is a non-transactional engine and it is the first row to be inserted
with multi-row, we also return the error. Otherwise, we proceed with the
execution, use implicit default values and print out warning messages.
Unfortunately, the current patch cannot mimic the behavior showed by the master
for updates on multi-tables and multi-row inserts. This happens because such
statements are unfolded in different row events. For instance, considering the
following updates and strict mode:
(master)
create table t1 (a int);
create table t2 (a int not null);
insert into t1 values (1);
insert into t2 values (2);
update t1, t2 SET t1.a=10, t2.a=NULL;
t1 would have (10) and t2 would have (0) as this would be handled as a
multi-row update. On the other hand, if we had the following updates:
(master)
create table t1 (a int);
create table t2 (a int);
(slave)
create table t1 (a int);
create table t2 (a int not null);
(master)
insert into t1 values (1);
insert into t2 values (2);
update t1, t2 SET t1.a=10, t2.a=NULL;
On the master t1 would have (10) and t2 would have (NULL). On
the slave, t1 would have (10) but the update on t1 would fail.
Backporting BUG#38173 to mysql-5.1-bugteam
The reason of the bug was incompatibile with the master side behaviour.
INSERT query on the master is allowed to insert into a table without specifying
values of DEFAULT-less fields if sql_mode is not strict.
Fixed with checking sql_mode by the sql thread to decide how to react.
Non-strict sql_mode should allow Write_rows event to complete.
todo: warnings can be shown via show slave status, still this is a
separate rather general issue how to show warnings for the slave threads.
The BINLOG statement was sharing too much code with the slave SQL thread, introduced with
the patch for Bug#32407. This caused statements to be logged with the wrong server_id, the
id stored inside the events of the BINLOG statement rather than the id of the running
server.
Fix by rearranging code a bit so that only relevant parts of the code are executed by
the BINLOG statement, and the server_id of the server executing the statements will
not be overrided by the server_id stored in the 'format description BINLOG statement'.
mysql-test/extra/binlog_tests/binlog.test:
Added test to verify if the server_id stored in the 'format
description BINLOG statement' will override the server_id
of the server executing the statements.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Test result for bug#46640
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Test result for bug#46640
sql/log_event.cc:
Moved rows_event_stmt_clean() call from update_pos() to apply_event(). This in any case
makes more sense, and is needed as update_pos() is no longer called when executing
BINLOG statements.
Moved setting of rli->relay_log.description_event_for_exec from
Format_description_log_event::do_update_pos() to
Format_description_log_event::do_apply_event()
sql/log_event_old.cc:
Moved rows_event_stmt_clean() call from update_pos() to apply_event(). This in any case
makes more sense, and is needed as update_pos() is no longer called when executing
BINLOG statements.
sql/slave.cc:
The skip flag is no longer needed, as the code path for BINLOG statement has been
cleaned up.
sql/sql_binlog.cc:
Don't invoke the update_pos() code path for the BINLOG statement, as it contains code
that is redundant and/or harmful (especially setting thd->server_id).
Let
- T be a transactional table and N non-transactional table.
- B be begin, C commit and R rollback.
- N be a statement that accesses and changes only N-tables.
- T be a statement that accesses and changes only T-tables.
In RBR, changes to N-tables that happen early in a transaction are not immediately flushed
upon committing a statement. This behavior may, however, break consistency in the presence
of concurrency since changes done to N-tables become immediately visible to other
connections. To fix this problem, we do the following:
. B N N T C would log - B N C B N C B T C.
. B N N T R would log - B N C B N C B T R.
Note that we are not preserving history from the master as we are introducing a commit that
never happened. However, this seems to be more acceptable than the possibility of breaking
consistency in the presence of concurrency.
Let
- T be a transactional table and N non-transactional table.
- B be begin, C commit and R rollback.
- M be a mixed statement, i.e. a statement that updates both T and N.
- M* be a mixed statement that fails while updating either T or N.
This patch restore the behavior presented in 5.1.37 for rows either produced in
the RBR or MIXED modes, when a M* statement that happened early in a transaction
had their changes written to the binary log outside the boundaries of the
transaction and wrapped in a BEGIN/ROLLBACK. This was done to keep the slave
consistent with with the master as the rollback would keep the changes on N and
undo them on T. In particular, we do what follows:
. B M* T C would log - B M* R B T C.
Note that, we are not preserving history from the master as we are introducing a
rollback that never happened. However, this seems to be more acceptable than
making the slave diverge. We do not fix the following case:
. B T M* C would log B T M* C.
The slave will diverge as the changes on T tables that originated from the M
statement are rolled back on the master but not on the slave. Unfortunately, we
cannot simply rollback the transaction as this would undo any uncommitted
changes on T tables.
SBR is not considered in this patch because a failing statement is written to
the binary along with the error code and a slave executes and then rolls back
the statement when it has an associated error code, thus undoing the effects
on T. In RBR and MBR, a full-fledged fix will be pushed after the WL 2687.
The problem is that there is only one autoinc value associated with
the query when binlogging. If more than one autoinc values are used
in the query, the autoinc values after the first one can be inserted
wrongly on slave. So these autoinc values can become inconsistent on
master and slave.
The problem is resolved by marking all the statements that invoke
a trigger or call a function that updated autoinc fields as unsafe,
and will switch to row-format in Mixed mode. Actually, the statement
is safe if just one autoinc value is used in sub-statement, but it's
impossible to check how many autoinc values are used in sub-statement.)
mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result:
Test result for bug#45677
mysql-test/suite/rpl/t/rpl_auto_increment_update_failure.test:
Added test to verify the following two properties:
P1) insert/update in an autoinc column causes statement to
be logged in row format if binlog_format=mixed
P2) if binlog_format=mixed, and a trigger or function contains
two or more inserts/updates in a table that has an autoinc
column, then the slave should not go out of sync, even if
there are concurrent transactions.
sql/sql_base.cc:
Added function 'has_write_table_with_auto_increment' to check
if one (or more) write tables have auto_increment columns.
Removed function 'has_two_write_locked_tables_with_auto_increment',
because the function is included in function
'has_write_table_with_auto_increment'.
vs not null
NOTE: Backporting the patch to next-mr.
The replication was generating corrupted data, warning messages on Valgrind
and aborting on debug mode while replicating a "null" to "not null" field.
Specifically the unpack_row routine, was considering the slave's table
definition and trying to retrieve a field value, where there was nothing to be
retrieved, ignoring the fact that the value was defined as "null" by the master.
To fix the problem, we proceed as follows:
1 - If it is not STRICT sql_mode, implicit default values are used, regardless
if it is multi-row or single-row statement.
2 - However, if it is STRICT mode, then a we do what follows:
2.1 If it is a transactional engine, we do a rollback on the first NULL that is
to be set into a NOT NULL column and return an error.
2.2 If it is a non-transactional engine and it is the first row to be inserted
with multi-row, we also return the error. Otherwise, we proceed with the
execution, use implicit default values and print out warning messages.
Unfortunately, the current patch cannot mimic the behavior showed by the master
for updates on multi-tables and multi-row inserts. This happens because such
statements are unfolded in different row events. For instance, considering the
following updates and strict mode:
(master)
create table t1 (a int);
create table t2 (a int not null);
insert into t1 values (1);
insert into t2 values (2);
update t1, t2 SET t1.a=10, t2.a=NULL;
t1 would have (10) and t2 would have (0) as this would be handled as a
multi-row update. On the other hand, if we had the following updates:
(master)
create table t1 (a int);
create table t2 (a int);
(slave)
create table t1 (a int);
create table t2 (a int not null);
(master)
insert into t1 values (1);
insert into t2 values (2);
update t1, t2 SET t1.a=10, t2.a=NULL;
On the master t1 would have (10) and t2 would have (NULL). On
the slave, t1 would have (10) but the update on t1 would fail.
NOTE: Backporting the patch to next-mr.
The reason of the bug was incompatibile with the master side behaviour.
INSERT query on the master is allowed to insert into a table without specifying
values of DEFAULT-less fields if sql_mode is not strict.
Fixed with checking sql_mode by the sql thread to decide how to react.
Non-strict sql_mode should allow Write_rows event to complete.
todo: warnings can be shown via show slave status, still this is a
separate rather general issue how to show warnings for the slave threads.
files
NOTE: this is the backport to next-mr.
SHOW BINLOG EVENTS does not work with relay log files. If issuing
"SHOW BINLOG EVENTS IN 'relay-log.000001'" in a non-empty relay
log file (relay-log.000001), mysql reports empty set.
This patch addresses this issue by extending the SHOW command
with RELAYLOG. Events in relay log files can now be inspected by
issuing SHOW RELAYLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT
[offset,] row_count].
mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc:
Shared part of the test case.
mysql-test/include/show_binlog_events.inc:
Added options $binary_log_file, $binary_log_limit_row,
$binary_log_limit_offset so that show_binlog_events can take
same parameters as SHOW BINLOG EVENTS does.
mysql-test/include/show_relaylog_events.inc:
Clone of show_binlog_events for relaylog events.
mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test:
Test case for row based replication.
mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test:
Test case for statement and mixed mode replication.
sql/lex.h:
Added RELAYLOG symbol.
sql/mysqld.cc:
Added "show_relaylog_events" to status_vars.
sql/sp_head.cc:
Set SQLCOM_SHOW_RELAYLOG_EVENTS to return flags=
sp_head::MULTI_RESULTS; in sp_get_flags_for_command as
SQLCOM_SHOW_BINLOG_EVENTS does.
sql/sql_lex.h:
Added sql_command SQLCOM_SHOW_RELAYLOG_EVENTS to lex enum_sql_command.
sql/sql_parse.cc:
Added handling of SQLCOM_SHOW_RELAYLOG_EVENTS.
sql/sql_repl.cc:
mysql_show_binlog_events set to choose the log file to use based on
the command issued (SHOW BINLOG|RELAYLOG EVENTS).
sql/sql_yacc.yy:
Added RELAYLOG to the grammar.
In RBR, 'DROP TEMPORARY TABLE IF EXISTS...' statement is binlogged when the table
does not exist.
In fact, 'DROP TEMPORARY TABLE ...' statement should never be binlogged in RBR
no matter if the table exists or not.
This patch addresses this by checking whether we are dropping a
temporary table or not, when building the custom drop statement.
failure to cleanup of table
The test case was not dropping a table before exiting (ie, it was
not cleaning itself after execution). In this case, the warning
message stating that the test did not do a proper cleanup was
deterministic (which can be annoying).
I have found other tests cases on which mtr sporadically reports
that they have not cleaned up after execution:
- rpl_ndb_circular
- rpl_failed_optimize
In this case, the master was dropping a table but there was no
synchronization between the slave and the master.
This patch addresses the rpl_ndb_circular_simplex case by adding
the missing DROP table. The other cases are fixed by deploying
the missing sync_slave_with_master instruction.
Network error happened here, but it can be caused by CR_CONNECTION_ERROR,
CR_CONN_HOST_ERROR, CR_SERVER_GONE_ERROR, CR_SERVER_LOST, ER_CON_COUNT_ERROR,
and ER_SERVER_SHUTDOWN. We just check CR_SERVER_LOST here, so the test fails.
To fix the problem, check all errors that can be cause by the master shutdown.
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
Added a 'if' sentence to check all errors that can be cause by the master shutdown.
mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result:
Test result is updated duo to the patch of bug#46931
When setting AUTOCOMMIT=1 after starting a transaction, the binary log
did not commit the outstanding transaction. The reason was that the binary
log commit function saw the values of the new settings, deciding that there
were nothing to commit.
Fixed the problem by moving the implicit commit to before the thread option
flags were changed, so that the binary log sees the old values of the flags
instead of the values they will take after the statement.
mysql-test/extra/binlog_tests/implicit.test:
New test file to check implicit commits both inside and outside transactions.
mysql-test/suite/binlog/t/binlog_implicit_commit.test:
Test for implicit commit of SET AUTOCOMMIT and LOCK/UNLOCK TABLES.
sql/set_var.cc:
Adding code to commit pending transaction before changing option flags.
In RBR, There is an inconsistency between slaves and master.
When INSERT statement which includes an auto_increment field is executed,
Store engine of master will check the value of the auto_increment field.
It will generate a sequence number and then replace the value, if its value is NULL or empty.
if the field's value is 0, the store engine will do like encountering the NULL values
unless NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.
In contrast, if the field's value is 0, Store engine of slave always generates a new sequence number
whether or not NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.
SQL MODE of slave sql thread is always consistency with master's.
Another variable is related to this bug.
If generateing a sequence number is decided by the values of
table->auto_increment_field_not_null and SQL_MODE(if includes MODE_NO_AUTO_VALUE_ON_ZERO)
The table->auto_increment_is_not_null is FALSE, which causes this bug to appear. ..
Essentially, Bug#45574 results in this bug. The 'CREATE DATABASE IF NOT EXISTS' statement was not
binlogged, when the database has existed.
Sometimes, the master and slaves become inconsistent. The "CREATE DATABASE
IF NOT EXISTS mysqltest1" statement is not binlogged
if the db 'mysqltest1' existed before the test case is executed.
So the db 'mysqltest1' can't be created on slave.
Patch of Bug#45574 has resolved this problem.
But I think it is better to replace 'mysqltest1' by default db 'test'.
Slave does not correctly handle "expected errors" leading to inconsistencies
between the mater and slave. Specifically, when a statement changes both
transactional and non-transactional tables, the transactional changes are
automatically rolled back on the master but the slave ignores the error and
does not roll them back thus leading to inconsistencies.
To fix the problem, we automatically roll back a statement that fails on
the slave but note that the transaction is not rolled back unless a "rollback"
command is in the relay log file.
mysql-test/extra/rpl_tests/rpl_mixing_engines.test:
Enabled item 13.e which was disabled because of the bug fixed by the
current and removed item 14 which was introduced by mistake.
binlog
Mixing transactional (T) and non-transactional (N) tables on behalf of a
transaction may lead to inconsistencies among masters and slaves in STATEMENT
mode. The problem stems from the fact that although modifications done to
non-transactional tables on behalf of a transaction become immediately visible
to other connections they do not immediately get to the binary log and therefore
consistency is broken. Although there may be issues in mixing T and M tables in
STATEMENT mode, there are safe combinations that clients find useful.
In this bug, we fix the following issue. Mixing N and T tables in multi-level
(e.g. a statement that fires a trigger) or multi-table table statements (e.g.
update t1, t2...) were not handled correctly. In such cases, it was not possible
to distinguish when a T table was updated if the sequence of changes was N and T.
In a nutshell, just the flag "modified_non_trans_table" was not enough to reflect
that both a N and T tables were changed. To circumvent this issue, we check if an
engine is registered in the handler's list and changed something which means that
a T table was modified.
Check WL 2687 for a full-fledged patch that will make the use of either the MIXED or
ROW modes completely safe.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Truncate statement is wrapped in BEGIN/COMMIT.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Truncate statement is wrapped in BEGIN/COMMIT.
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().
The "get_master_version_and_clock(...)" function in sql/slave.cc ignores
error and passes directly when queries fail, or queries succeed
but the result retrieved is empty.
The "get_master_version_and_clock(...)" function should try to reconnect master
if queries fail because of transient network problems, and fail otherwise.
The I/O thread should print a warning if the some system variables do not
exist on master (very old master)
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
Added test file for bug #45214
mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result:
Added test result for bug #45214
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
Added test file for bug #45214
sql/slave.cc:
The 'is_network_error()' function is added for checking if the error is caused by network.
Added a new return value (2) to 'get_master_version_and_clock()' function result set
to indicate transient network errors when queries fail, and the caller should
try to reconnect in this case.
NOTE: This undoes changes by BUG#42829 in sql_class.cc:binlog_query().
I will revert the change in a post-push fix (the binlog filter should
be checked in sql_base.cc:decide_logging_format()).
General overview:
The logic for switching to row format when binlog_format=MIXED had
numerous flaws. The underlying problem was the lack of a consistent
architecture.
General purpose of this changeset:
This changeset introduces an architecture for switching to row format
when binlog_format=MIXED. It enforces the architecture where it has
to. It leaves some bugs to be fixed later. It adds extensive tests to
verify that unsafe statements work as expected and that appropriate
errors are produced by problems with the selection of binlog format.
It was not practical to split this into smaller pieces of work.
Problem 1:
To determine the logging mode, the code has to take several parameters
into account (namely: (1) the value of binlog_format; (2) the
capabilities of the engines; (3) the type of the current statement:
normal, unsafe, or row injection). These parameters may conflict in
several ways, namely:
- binlog_format=STATEMENT for a row injection
- binlog_format=STATEMENT for an unsafe statement
- binlog_format=STATEMENT for an engine only supporting row logging
- binlog_format=ROW for an engine only supporting statement logging
- statement is unsafe and engine does not support row logging
- row injection in a table that does not support statement logging
- statement modifies one table that does not support row logging and
one that does not support statement logging
Several of these conflicts were not detected, or were detected with
an inappropriate error message. The problem of BUG#39934 was that no
appropriate error message was written for the case when an engine
only supporting row logging executed a row injection with
binlog_format=ROW. However, all above cases must be handled.
Fix 1:
Introduce new error codes (sql/share/errmsg.txt). Ensure that all
conditions are detected and handled in decide_logging_format()
Problem 2:
The binlog format shall be determined once per statement, in
decide_logging_format(). It shall not be changed before or after that.
Before decide_logging_format() is called, all information necessary to
determine the logging format must be available. This principle ensures
that all unsafe statements are handled in a consistent way.
However, this principle is not followed:
thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
places, including from code executing UPDATE..LIMIT,
INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
SET @@binlog_format. After Problem 1 was fixed, that caused
inconsistencies where these unsafe statements would not print the
appropriate warnings or errors for some of the conflicts.
Fix 2:
Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
code executed after decide_logging_format(). Compensate by calling the
set_current_stmt_unsafe() at parse time. This way, all unsafe statements
are detected by decide_logging_format().
Problem 3:
INSERT DELAYED is not unsafe: it is logged in statement format even if
binlog_format=MIXED, and no warning is printed even if
binlog_format=STATEMENT. This is BUG#45825.
Fix 3:
Made INSERT DELAYED set itself to unsafe at parse time. This allows
decide_logging_format() to detect that a warning should be printed or
the binlog_format changed.
Problem 4:
LIMIT clause were not marked as unsafe when executed inside stored
functions/triggers/views/prepared statements. This is
BUG#45785.
Fix 4:
Make statements containing the LIMIT clause marked as unsafe at
parse time, instead of at execution time. This allows propagating
unsafe-ness to the view.
mysql-test/extra/rpl_tests/create_recursive_construct.inc:
Added auxiliary file used by binlog_unsafe.test to create and
execute recursive constructs
(functions/procedures/triggers/views/prepared statements).
mysql-test/extra/rpl_tests/rpl_foreign_key.test:
removed unnecessary set @@session.binlog_format
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Filter out table id from table map events in binlog listing.
Got rid of $binlog_format_statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
disable warnings around call to unsafe procedure
mysql-test/include/rpl_udf.inc:
Disabled warnings for code that generates warnings
for some binlog formats. That would otherwise cause
inconsistencies in the result file.
mysql-test/r/mysqldump.result:
Views are now unsafe if they contain a LIMIT clause.
That fixed BUG#45831. Due to BUG#45832, a warning is
printed for the CREATE VIEW statement.
mysql-test/r/sp_trans.result:
Unsafe statements in stored procedures did not give a warning if
binlog_format=statement. This is BUG#45824. Now they do, so this
result file gets a new warning.
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Error message changed.
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
INSERT DELAYED didn't generate a warning when binlog_format=STATEMENT.
That was BUG#45825. Now there is a warning, so result file needs to be
updated.
mysql-test/suite/binlog/r/binlog_stm_ps.result:
Changed error message.
mysql-test/suite/binlog/r/binlog_unsafe.result:
updated result file:
- error message changed
- added test for most combinations of unsafe constructs invoked
from recursive constructs
- INSERT DELAYED now gives a warning (because BUG#45826 is fixed)
- INSERT..SELECT..LIMIT now gives a warning from inside recursive
constructs (because BUG#45785 was fixed)
- When a recursive construct (e.g., stored proc or function)
contains more than one statement, at least one of which is
unsafe, then all statements in the recursive construct give
warnings. This is a new bug introduced by this changeset.
It will be addressed in a post-push fix.
mysql-test/suite/binlog/t/binlog_innodb.test:
Changed error code for innodb updates with READ COMMITTED or
READ UNCOMMITTED transaction isolation level and
binlog_format=statement.
mysql-test/suite/binlog/t/binlog_multi_engine.test:
The error code has changed for statements where more than one
engine is involved and one of them is self-logging.
mysql-test/suite/binlog/t/binlog_unsafe-master.opt:
Since binlog_unsafe now tests unsafe-ness of UDF's, we need an extra
flag in the .opt file.
mysql-test/suite/binlog/t/binlog_unsafe.test:
- Clarified comment.
- Rewrote first part of test. Now it tests not only unsafe variables
and functions, but also unsafe-ness due to INSERT..SELECT..LIMIT,
INSERT DELAYED, insert into two autoinc columns, use of UDF's, and
access to log tables in the mysql database.
Also, in addition to functions, procedures, triggers, and prepared
statements, it now also tests views; and it constructs recursive
calls in two levels by combining these recursive constructs.
Part of the logic is in extra/rpl_tests/create_recursive_construct.inc.
- added tests for all special system variables that should not be unsafe.
- added specific tests for BUG#45785 and BUG#45825
mysql-test/suite/rpl/r/rpl_events.result:
updated result file
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
updated result file
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
updated result file
mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result:
updated result file
mysql-test/suite/rpl/r/rpl_idempotency.result:
updated result file
mysql-test/suite/rpl/r/rpl_mix_found_rows.result:
Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file equals
the second half of the old rpl_found_rows.result, with the following
modifications:
- minor formatting changes
- additional initialization
mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result:
Moved out code operating in mixed mode from rpl_stm_insert_delayed
(into rpl_mix_insert_delayed) and got rid of explicit setting of
binlog format.
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
updated result file
mysql-test/suite/rpl/r/rpl_row_idempotency.result:
Moved the second half of rpl_idempotency.test, which only
executed in row mode, to rpl_row_idempotency.test. This is
the new result file.
mysql-test/suite/rpl/r/rpl_row_insert_delayed.result:
Got rid of unnecessary explicit setting of binlog format.
mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
this file:
- minor formatting changes
- warning is now issued for unsafe statements inside procedures
(since BUG#45824 is fixed)
- second half of file is moved to rpl_mix_found_rows.result
mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result:
Moved out code operating in mixed mode from rpl_stm_insert_delayed
(into rpl_mix_insert_delayed) and got rid of explicit setting of
binlog format.
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
error message changed
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
updated result file
mysql-test/suite/rpl/r/rpl_udf.result:
Remove explicit set of binlog format (and triplicate test execution)
and rely on test system executing the test in all binlog formats.
mysql-test/suite/rpl/t/rpl_bug31076.test:
Test is only valid in mixed or row mode since it generates row events.
mysql-test/suite/rpl/t/rpl_events.test:
Removed explicit set of binlog_format and removed duplicate testing.
Instead, we rely on the test system to try all binlog formats.
mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test:
Removed triplicate testing and instead relying on test system.
Test is only relevant for row format since statement-based replication
cannot handle extra columns on master.
mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test:
Removed triplicate testing and instead relying on test system.
Test is only relevant for row format since statement-based replication
cannot handle extra columns on master.
mysql-test/suite/rpl/t/rpl_idempotency-slave.opt:
Removed .opt file to avoid server restarts.
mysql-test/suite/rpl/t/rpl_idempotency.test:
- Moved out row-only tests to a new test file, rpl_row_idempotency.test.
rpl_idempotency now only contains tests that execute in all
binlog_formats.
- While I was here, also removed .opt file to avoid server restarts.
The slave_exec_mode is now set inside the test instead.
mysql-test/suite/rpl/t/rpl_mix_found_rows.test:
Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file
contains the second half of the original rpl_found_rows.test with the
follwing changes:
- initialization
- removed SET_BINLOG_FORMAT and added have_binlog_format_mixed.inc
- minor formatting changes
mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test:
Moved out code operating in mixed mode from rpl_stm_insert_delayed
(into rpl_mix_insert_delayed) and got rid of explicit setting of
binlog format.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
Test cannot execute in statement mode, since we no longer
switch to row format when binlog_format=statement.
Enforced mixed mode throughout the test.
mysql-test/suite/rpl/t/rpl_row_idempotency.test:
Moved the second half of rpl_idempotency.test, which only
executed in row mode, to this new file. We now rely on the
test system to set binlog format.
mysql-test/suite/rpl/t/rpl_row_insert_delayed.test:
- Got rid of unnecessary explicit setting of binlog format.
- extra/rpl_tests/rpl_insert_delayed.test does not need the
$binlog_format_statement variable any more, so that was
removed.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
The test switches binlog_format internally and master generates both
row and statement events. Hence, the slave must be able to log in both
statement and row format. Hence test was changed to only execute in
mixed mode.
mysql-test/suite/rpl/t/rpl_stm_found_rows.test:
Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and
rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in
this file:
- minor formatting changes
- added have_binlog_format_statement and removed SET BINLOG_FORMAT.
- second half of file is moved to rpl_mix_found_rows.test
- added cleanup code
mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test:
Moved out code operating in mixed mode from rpl_stm_insert_delayed
(into rpl_mix_insert_delayed) and got rid of explicit setting of
binlog format.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
The test switches binlog_format internally and master generates both
row and statement events. Hence, the slave must be able to log in both
statement and row format. Hence test was changed to only execute in
mixed mode on slave.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Removed explicit set of binlog format. Instead, the test now only
executes in row mode.
mysql-test/suite/rpl/t/rpl_udf.test:
Remove explicit set of binlog format (and triplicate test execution)
and rely on test system executing the test in all binlog formats.
mysql-test/suite/rpl_ndb/combinations:
Added combinations file for rpl_ndb.
mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
new result file
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result:
updated result file
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt:
new option file
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt:
new option file
mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
New test case to verify all errors and warnings generated by
decide_logging_format.
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
While I was here, also made the test clean up after itself.
mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test:
The test needs slave to be able to switch to row mode, so the
test was changed to only execute in mixed and row mode.
mysql-test/t/partition_innodb_stmt.test:
Changed error code for innodb updates with READ COMMITTED or
READ UNCOMMITTED transaction isolation level and
binlog_format=statement.
sql/event_db_repository.cc:
Use member function to read current_stmt_binlog_row_based.
sql/events.cc:
Use member function to read current_stmt_binlog_row_based.
sql/ha_ndbcluster_binlog.cc:
reset_current_stmt_binlog_row_based() is not a no-op for the ndb_binlog
thread any more. Instead, the ndb_binlog thread now forces row mode both
initially and just after calling mysql_parse. (mysql_parse() is the only
place where reset_current_stmt_binlog_row_based() may be called from
the ndb_binlog thread, so these are the only two places that need to
change.)
sql/ha_partition.cc:
Use member function to read current_stmt_binlog_row_based.
sql/handler.cc:
Use member function to read current_stmt_binlog_row_based.
sql/item_create.cc:
Added DBUG_ENTER to some functions, to be able to trace when
set_stmt_unsafe is called.
sql/log.cc:
Use member function to read current_stmt_binlog_row_based.
sql/log_event.cc:
- Moved logic for changing to row format out of do_apply_event (and into
decide_logging_format).
- Added @todo comment for post-push cleanup.
sql/log_event_old.cc:
Move logic for changing to row format out of do_apply_event (and into
decide_logging_format).
sql/mysql_priv.h:
Make decide_logging_format() a member of the THD class, for two reasons:
- It is natural from an object-oriented perspective.
- decide_logging_format() needs to access private members of THD
(specifically, the new binlog_warning_flags field).
sql/rpl_injector.cc:
Removed call to set_current_stmt_binlog_row_based().
From now on, only decide_logging_fromat is allowed to modify
current_stmt_binlog_row_based. This call is from the ndb_binlog
thread, mostly executing code in ha_ndbcluster_binlog.cc.
This call can be safely removed, because:
- current_stmt_binlog_row_based is initialized for the ndb_binlog
thread's THD object when the THD object is created. So we're
not going to read uninitialized memory.
- The behavior of ndb_binlog thread does not use the state of the
current_stmt_binlog_row_based. It is conceivable that the
ndb_binlog thread would rely on the current_stmt_binlog_format
in two situations:
(1) when it calls mysql_parse;
(2) when it calls THD::binlog_query.
In case (1), it always clears THD::options&OPTION_BIN_LOG (because
run_query() in ha_ndbcluster_binlog.cc is only called with
disable_binlogging = TRUE).
In case (2), it always uses qtype=STMT_QUERY_TYPE.
sql/set_var.cc:
Added @todo comment for post-push cleanup.
sql/share/errmsg.txt:
Added new error messages and clarified ER_BINLOG_UNSAFE_STATEMENT.
sql/sp.cc:
Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
sql/sp_head.cc:
Use member function to read current_stmt_binlog_row_based.
sql/sp_head.h:
Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
sql/sql_acl.cc:
Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE.
sql/sql_base.cc:
- Made decide_logging_format take care of all logic for deciding the
logging format, and for determining the related warnings and errors.
See comment above decide_logging_format for details.
- Made decide_logging_format a member function of THD, since it needs
to access private members of THD and since its purpose is to update
the state of a THD object.
- Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called.
sql/sql_class.cc:
- Moved logic for determining unsafe warnings away from THD::binlog_query
(and into decide_logging_format()). Now, it works like this:
1. decide_logging_format detects that the current statement shall
produce a warning, if it ever makes it to the binlog
2. decide_logging_format sets a flag of THD::binlog_warning_flags.
3. THD::binlog_query reads the flag. If the flag is set, it generates
a warning.
- Use member function to read current_stmt_binlog_row_based.
sql/sql_class.h:
- Added THD::binlog_warning_flags (see sql_class.cc for explanation).
- Made decide_logging_format() and reset_for_next_command() member
functions of THD (instead of standalone functions). This was needed
for two reasons: (1) the functions need to access the private member
THD::binlog_warning_flags; (2) the purpose of these functions is to
update the staet of a THD object, so from an object-oriented point
of view they should be member functions.
- Encapsulated current_stmt_binlog_row_based, so it is now private and
can only be accessed from a member function. Also changed the
data type to an enumeration instead of a bool.
- Removed MYSQL_QUERY_TYPE, because it was equivalent to
STMT_QUERY_TYPE anyways.
- When reset_current_stmt_binlog_row_based was called from the
ndb_binlog thread, it would behave as a no-op. This special
case has been removed, and the behavior of
reset_current_stmt_binlog_row_based does not depend on which thread
calls it any more. The special case did not serve any purpose,
since the ndb binlog thread did not take the
current_stmt_binlog_row_based flag into account anyways.
sql/sql_delete.cc:
- Moved logic for setting row format for DELETE..LIMIT away from
mysql_prepare_delete.
(Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
and rely on decide_logging_format() (sql_class.cc) to set row format.)
This is part of the fix for BUG#45831.
- Use member function to read current_stmt_binlog_row_based.
sql/sql_insert.cc:
- Removed unnecessary calls to thd->lex->set_stmt_unsafe() and
thd->set_current_stmt_binlog_row_based_if_mixed() from
handle_delayed_insert(). The calls are unnecessary because they
have already been made; they were made in the constructor of
the `di' object.
- Since decide_logging_format() is now a member function of THD, code
that calls decide_logging_format() had to be updated.
- Added DBUG_ENTER call, to be able to trace when set_stmt_unsafe is
called.
- Moved call to set_stmt_unsafe() for INSERT..SELECT..LIMIT away from
mysql_insert_select_prepare() (and into decide_logging_format).
This is part of the fix for BUG#45831.
- Use member function to read current_stmt_binlog_row_based.
sql/sql_lex.h:
- Added the flag BINLOG_STMT_FLAG_ROW_INJECTION to enum_binlog_stmt_flag.
This was necessary so that a statement can identify itself as a row
injection.
- Added appropriate setter and getter functions for the new flag.
- Added or clarified some comments.
- Added DBUG_ENTER()
sql/sql_load.cc:
Use member function to read current_stmt_binlog_row_based.
sql/sql_parse.cc:
- Made mysql_reset_thd_for_next_command() clear thd->binlog_warning_flags.
- Since thd->binlog_warning_flags is private, it must be set in a
member function of THD. Hence, moved the body of
mysql_reset_thd_for_next_command() to the new member function
THD::reset_thd_for_next_command(), and made
mysql_reset_thd_for_next_command() call
THD::reset_thd_for_next_command().
- Removed confusing comment.
- Use member function to read current_stmt_binlog_row_based.
sql/sql_repl.cc:
Use member function to read current_stmt_binlog_row_based.
sql/sql_table.cc:
Use member function to read current_stmt_binlog_row_based.
sql/sql_udf.cc:
Use member function to read current_stmt_binlog_row_based.
sql/sql_update.cc:
Moved logic for setting row format for UPDATE..LIMIT away from
mysql_prepare_update.
(Instead, we mark the statement as unsafe at parse time (sql_yacc.yy)
and rely on decide_logging_format() (sql_class.cc) to set row format.)
This is part of the fix for BUG#45831.
sql/sql_yacc.yy:
Made INSERT DELAYED, INSERT..SELECT..LIMIT, UPDATE..LIMIT, and
DELETE..LIMIT mark themselves as unsafe at parse time (instead
of at execution time).
This is part of the fixes BUG#45831 and BUG#45825.
storage/example/ha_example.cc:
Made exampledb accept inserts. This was needed by the new test case
rpl_ndb_binlog_format_errors, because it needs an engine that
is statement-only (and accepts inserts).
storage/example/ha_example.h:
Made exampledb a statement-only engine instead of a row-only engine.
No existing test relied exampledb's row-only capabilities. The new
test case rpl_ndb_binlog_format_errors needs an engine that is
statement-only.
storage/innobase/handler/ha_innodb.cc:
- Changed error error code and message given by innodb when
binlog_format=STATEMENT and transaction isolation level is
READ COMMITTED or READ UNCOMMITTED.
- While I was here, also simplified the condition for
checking when to give the error.
"create as select" (innodb table)
Problem: code constructing "CREATE TABLE..." statement
doesn't take into account that current database is not set
in some cases. That may lead to a server crash.
Fix: check if current database is set.
mysql-test/extra/binlog_tests/binlog.test:
Fix for bug#45998: database crashes when running
"create as select" (innodb table)
- test case.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Fix for bug#45998: database crashes when running
"create as select" (innodb table)
- test result.
sql/sql_show.cc:
Fix for bug#45998: database crashes when running
"create as select" (innodb table)
- added check if there's current database set.
The test case added failed sporadically on PB. This is due to the
fact that the user thread in some cases is waiting for slave IO
to stop and then check the error number. Thence, sometimes the
user thread would race for the error number with IO thread.
This post push fix addresses this by replacing the wait for slave
io to stop with a wait for slave io error (as it seems it was
added in 6.0 also after patch on which this is based was
pushed). This implied backporting wait_for_slave_io_error.inc
from 6.0 also.
The server was not cleaning the last IO error and error number when
resetting slave.
This patch addresses this issue by backporting into 5.1 part of the
patch in BUG 34654. A fix for this issue had already been pushed into
6.0 as part of the aforementioned bug, however the patch also included
some refactoring. The fix for 5.1 does not take into account the
refactoring part.
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Backported the test case and improved with deploying include/start_slave.inc
in relevant spots.
sql/slave.cc:
Backported part of patch from 6.0 that includes cleaning
mi->clear_error() at:
1. beginning of handle_slave_io
2. on successful connection
Also, backported the assertion added in the original patch.
sql/sql_repl.cc:
Backported the call to mi->clear_error() on reset_slave().
1. Test case was rewritten completely.
2. Test covers 3 cases:
a) do deadlock on slave, wait retries of transaction, unlock slave before lock
timeout;
b) do deadlock on slave and wait error 'lock timeout exceed' on slave;
c) same as b) but if of max relay log size = 0;
3. Added comments inline.
4. Updated result file.
LOAD_FILE
LOAD_FILE is not safe to replicate in STATEMENT mode, because it
depends on a file (which is loaded on master and may not exist in
slave(s)). This leads to scenarios on which the slave replicates the
statement with 'load_file' and it will try to load the file from local
file system. Given that the file may not exist in the slave filesystem
the operation will not succeed (probably returning NULL), causing
master and slave(s) to diverge. However, when using MIXED mode
replication, this can be made to work, if the statement including
LOAD_FILE is marked as unsafe, triggering a switch to ROW mode,
meaning that the contents of the file are written to binlog as row
events. Consequently, the contents from the file in the master will
reach the slave via the binlog.
This patch addresses this bug by marking the load_file function as
unsafe. When in mixed mode and when LOAD_FILE is issued, there will be
a switch to row mode. Furthermore, when in statement mode, the
LOAD_FILE will raise a warning that the statement is unsafe in that
mode.
mysql-test/extra/rpl_tests/rpl_loadfile.test:
Extra file that is "sourced" on both rpl_loadfile and rpl_stm_loadfile
test files.
mysql-test/suite/rpl/r/rpl_loadfile.result:
Updated with the results from the test case added to this file.
mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
Result file for rpl_loadfile test split with the warnings in statement
mode.
mysql-test/suite/rpl/t/rpl_loadfile.test:
After splitting the original rpl_loadfile file, this one is only
required to be executed in mixed or row format.
Appended the test for 39701 to this file.
mysql-test/suite/rpl/t/rpl_stm_loadfile.test:
Split the original rpl_loadfile test because load_file now raises
a warning when in statement mode. The goal of this split is
two-fold: i) make the test case more resilient; ii) assert that
warnings are indeed raised when in statement mode.
sql/item_create.cc:
Added the set_stmt_unsafe call to lex.
TRUNCATE TABLE fails to replicate when stmt-based binlogging is not supported.
There were two separate problems with the code, both of which are fixed with
this patch:
1. An error was printed by InnoDB for TRUNCATE TABLE in statement mode when
the in isolation levels READ COMMITTED and READ UNCOMMITTED since InnoDB
does permit statement-based replication for DML statements. However,
the TRUNCATE TABLE is not transactional, but is a DDL, and should therefore
be allowed to be replicated as a statement.
2. The statement was not logged in mixed mode because of the error above, but
the error was not reported to the client.
This patch fixes the problem by treating TRUNCATE TABLE a DDL, that is, it is
always logged as a statement and not reporting an error from InnoDB for TRUNCATE
TABLE.
mysql-test/extra/binlog_tests/binlog_truncate.test:
Adding new test to check that TRUNCATE TABLE is written correctly
to the binary log.
mysql-test/extra/rpl_tests/rpl_truncate.test:
Removing redundant testing by eliminating settings of BINLOG_FORMAT.
mysql-test/extra/rpl_tests/rpl_truncate_helper.test:
Replacing slave and master reset code with include file.
Removing settings of BINLOG_FORMAT.
Replacing printing of table contents to compare master and slave
with diff_tables.inc.
mysql-test/suite/binlog/t/binlog_truncate_innodb.test:
Adding test for testing that TRUNCATE TABLE is logged correctly for InnoDB
in all isolation levels.
mysql-test/suite/binlog/t/binlog_truncate_myisam.test:
Adding test for testing that TRUNCATE TABLE is logged correctly for MyISAM.
mysql-test/suite/binlog/t/disabled.def:
Disabling binlog_truncate_innodb since it does not work (yet).
sql/sql_base.cc:
Correcting setting of capabilities flags to make the comparison with 0
later in the code work correctly.
sql/sql_delete.cc:
Re-organizing code to ensure that TRUNCATE TABLE is logged in statement
format and that row format is not used unless there are rows to log (which
there are not when delete_all_rows() is called, so this has to be logged
as a statement).
Documented behaviour was broken by the patch for bug 33699
that actually is not a bug.
This fix reverts patch for bug 33699 and reverts the
UPDATE of NOT NULL field with NULL query to old
behavior.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/include/ps_modify.inc:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/auto_increment.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/csv_not_null.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/null.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_2myisam.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_3innodb.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_4heap.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_5merge.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/warnings.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/ndb/r/ps_7ndb.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/auto_increment.test:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/csv_not_null.test:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/null.test:
Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/warnings.test:
Bug #39265: fix for the bug 33699 should be reverted
sql/sql_update.cc:
Bug #39265: fix for the bug 33699 should be reverted
Remove size of binlog file from SHOW BINARY LOGS.
Changing size of binlog file is an affect of adding or removing events to/from
binlog and it can be checked in next command of test: SHOW BINLOG EVENTS.
For SHOW BINARY LOGS statement enough to show the list of file names.
conflicts:
Text conflict in client/mysqltest.cc
Text conflict in mysql-test/include/wait_until_connected_again.inc
Text conflict in mysql-test/lib/mtr_report.pm
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/r/events_bugs.result
Text conflict in mysql-test/r/log_state.result
Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
Text conflict in mysql-test/r/mysqlcheck.result
Text conflict in mysql-test/r/query_cache.result
Text conflict in mysql-test/r/status.result
Text conflict in mysql-test/suite/binlog/r/binlog_index.result
Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
Text conflict in mysql-test/t/disabled.def
Text conflict in mysql-test/t/events_bugs.test
Text conflict in mysql-test/t/log_state.test
Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
Text conflict in mysql-test/t/mysqlcheck.test
Text conflict in mysql-test/t/query_cache.test
Text conflict in mysql-test/t/rpl_init_slave_func.test
Text conflict in mysql-test/t/status.test
The next number (AUTO_INCREMENT) field of the table for write
rows events are not initialized, and cause some engines (innodb)
not correctly update the tables's auto_increment value.
This patch fixed this problem by honor next number fields if present.
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
Add test code for BUG#41986
mysql-test/suite/rpl/r/rpl_auto_increment.result:
update test result file for BUG#41986
sql/log_event.cc:
set next_number_field before writing rows, and reset next_number_field after finished writing rows
Added cleanup of status variables to the end of binlog_database.
Re-recorded .result file to account for cleanup statement.
NOTE: binlog.binlog_innodb also has had an FLUSH STATUS; statement added to it as well, but
adding this cleanup as a preventative measure.
Problem 1: The test waits for an error in the slave sql thread,
then resolves the error and issues 'start slave'. However, there
is a gap between when the error is reported and the slave sql
thread stops. If this gap was long, the slave would still be
running when 'start slave' happened, so 'start slave' would fail
and cause a test failure.
Fix 1: Made wait_for_slave_sql_error wait for the slave to stop
instead of wait for error in the IO thread. After stopping, the
error code is verified. If the error code is wrong, debug info
is printed. To print debug info, the debug printing code in
wait_for_slave_param.inc was moved out to a new file,
show_rpl_debug_info.inc.
Problem 2: rpl_stm_mystery22 is a horrible name, the comments in
the file didn't explain anything useful, the test was generally
hard to follow, and the test was essentially duplicated between
rpl_stm_mystery22 and rpl_row_mystery22.
Fix 2: The test is about conflicts in the slave SQL thread,
hence I renamed the tests to rpl_{stm,row}_conflicts. Refactored
the test so that the work is done in
extra/rpl_tests/rpl_conflicts.inc, and
rpl.rpl_{row,stm}_conflicts merely sets some variables and then
sourced extra/rpl_tests/rpl_conflicts.inc.
The tests have been rewritten and comments added.
Problem 3: When calling wait_for_slave_sql_error.inc, you always
want to verify that the sql thread stops because of the expected
error and not because of some other error. Currently,
wait_for_slave_sql_error.inc allows the caller to omit the error
code, in which case all error codes are accepted.
Fix 3: Made wait_for_slave_sql_error.inc fail if no error code
is given. Updated rpl_filter_tables_not_exist accordingly.
Problem 4: rpl_filter_tables_not_exist had a typo, the dollar
sign was missing in a 'let' statement.
Fix 4: Added dollar sign.
Problem 5: When replicating from other servers than the one named
'master', the wait_for_slave_* macros were unable to print debug
info on the master.
Fix 5: Replace parameter $slave_keep_connection by
$master_connection.
mysql-test/extra/rpl_tests/rpl_conflicts.test:
rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed:
The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test
just set some parameters, and then source include/rpl_tests/rpl_conflicts.test.
Also, cleaned up the test case a bit, and fixed BUG#37718.
mysql-test/include/show_rpl_debug_info.inc:
Factored out the debug printing code from wait_for_slave_param.inc to
a new file, show_rpl_debug_info.inc.
Also removed the $slave_keep_connection parameter, and replaced it by
$master_connection. This allows printing debug info on the master, no
matter what the name of the master connection is.
mysql-test/include/start_slave.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/stop_slave.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/sync_slave_io_with_master.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_io_to_start.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_io_to_stop.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_param.inc:
Factored out the debug printing code from wait_for_slave_param.inc to
a new file, show_rpl_debug_info.inc.
Also removed the $slave_keep_connection parameter, and replaced it by
$master_connection. This allows printing debug info on the master, no
matter what the name of the master connection is.
Had to move the printing of debug info out of the while loop because
of BUG number 41913.
mysql-test/include/wait_for_slave_sql_error.inc:
Made it wait until the slave sql thread has stopped. This
takes very short time and avoids race condition bugs in
test cases (e.g., fixes BUG#37718).
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_sql_error_and_skip.inc:
Since wait_for_slave_sql_error now waits for the slave sql
thread to stop too, wait_for_slave_sql_error_and_skip does not
have to wait for the slave sql thread to stop.
Also, since wait_for_slave_sql_error now requires the parameter
$slave_sql_errno to be set, wait_for_slave_sql_error_and_skip
requires that as well: updated the usage instructions.
mysql-test/include/wait_for_slave_sql_to_start.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_sql_to_stop.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_to_start.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/include/wait_for_slave_to_stop.inc:
Replaced $slave_keep_connection by $master_connection.
mysql-test/suite/rpl/r/rpl_row_conflicts.result:
update result file
mysql-test/suite/rpl/r/rpl_stm_conflicts.result:
update result file
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Replaced $slave_keep_connection by $master_connection.
mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test:
Set $slave_sql_errno, since it is now required.
Add dollar sign to $show_sql_error (without dollar sign,
mtr makes it an environment variable).
mysql-test/suite/rpl/t/rpl_row_conflicts.test:
rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed:
The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test
just set some parameters, and then source include/rpl_tests/rpl_conflicts.test.
Also, cleaned up the test case a bit, and fixed BUG#37718.
mysql-test/suite/rpl/t/rpl_row_mystery22.test:
rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed:
The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test
just set some parameters, and then source include/rpl_tests/rpl_conflicts.test.
Also, cleaned up the test case a bit, and fixed BUG#37718.
mysql-test/suite/rpl/t/rpl_stm_conflicts.test:
rpl_stm_mystery22 and rpl_row_mystery22 have now been refactored and renamed:
The two test cases rpl.rpl_stm_conflicts.test and rpl.rpl_row_conflicts.test
just set some parameters, and then source include/rpl_tests/rpl_conflicts.test.
Also, cleaned up the test case a bit, and fixed BUG#37718.
where timeout can happen:
1. Added waiting start/stop slave to make sure that slave works properly.
2. Added cleanup for slave.
3. Updated related result files.
Problem: Many test cases don't clean up after themselves (fail
to drop tables or fail to reset variables). This implies that:
(1) check-testcase in the new mtr that currently lives in
5.1-rpl failed. (2) it may cause unexpected results in
subsequent tests.
Fix: make all tests clean up.
Also: cleaned away unnecessary output in rpl_packet.result
Also: fixed bug where rpl_log called RESET MASTER with a running
slave. This is not supposed to work.
Also: removed unnecessary code from rpl_stm_EE_err2 and made it
verify that an error occurred.
Also: removed unnecessary code from rpl_ndb_ctype_ucs2_def.
mysql-test/extra/rpl_tests/rpl_loaddata.test:
Made test clean up after itself.
mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test:
Made test clean up after itself.
Also removed unnecessary save_master_pos.
Also made test verify that an error occurred.
mysql-test/extra/rpl_tests/rpl_truncate_helper.test:
Made test clean up after itself.
mysql-test/include/query_cache.inc:
Made test clean up after itself.
mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test:
Made test clean up after itself.
mysql-test/suite/rpl/t/rpl_alter_db.test:
Made test clean up after itself.
Easiest to refactor the test a little, to use an auxiliary database instead of mysql:
Then we don't need to read the collation at the start of the test and reset it at the
end of the test. We can just drop the database.
mysql-test/suite/rpl/t/rpl_drop_db.test:
Made test clean up after itself.
mysql-test/suite/rpl/t/rpl_drop_view.test:
Made test clean up after itself.
mysql-test/suite/rpl/t/rpl_events.test:
Made test clean up after itself.
mysql-test/suite/rpl/t/rpl_idempotency.test:
Made test clean up after itself.
mysql-test/suite/rpl/t/rpl_ignore_table.test:
Made test clean up after itself.
The existing cleanup code didn't work, because the --replicate-*
options prevented the "drop table" from being replicated. Moved
"drop table t4" to a statement of its own.
mysql-test/suite/rpl/t/rpl_packet.test:
Made test clean up after itself.
Also replaced SHOW SLAVE STATUS by query_get_value(SHOW SLAVE STATUS...),
since only one column of the result was interesting.
mysql-test/suite/rpl/t/rpl_row_max_relay_size.test:
Made test clean up after itself.
Instead of setting binlog format at the beginning of the test, we just
do 'source include/have_binlog_format_row.inc' like all other tests.
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test:
Made test clean up after itself.
mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test:
Made test clean up after itself.
Also removed unnecessary 'create table; drop table'
Also removed unnecessary use of --command
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Made test clean up after itself.
mysql-test/t/innodb-autoinc-optimize.test:
Made test clean up after itself.
mysql-test/t/innodb.test:
Made test clean up after itself.
mysql-test/t/log_tables.test:
Made test clean up after itself.
mysql-test/t/mysql_client_test.test:
Made test clean up after itself.
mysql-test/t/partition.test:
Made test clean up after itself.
mysql-test/t/status.test:
Made test clean up after itself.
a test on the bug page does not reveal the problem with the latest trees.
Adding the test to the rpl suite in order to monitor regression.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
a regression test for the bug#38230.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
results changed.
mysql-test/extra/rpl_tests/rpl_log.test:
Using RESET MASTER in the middle of a sequence of statements cause
a race condition between the dump thread sending the preceeding
statements to the slave and the RESET MASTER.
mysql-test/suite/federated/federated.test:
Fixing include paths.
mysql-test/suite/federated/federated_bug_25714.test:
Removing extreneous lines added by merge.
mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test:
Correcting typo (the spaces following the connection name was included as part of the name).
mysql-test/t/distinct.test:
Correcting paths.
In certain situations, a scan of the table will return the error
code HA_ERR_RECORD_DELETED, and this error code is not
correctly caught in the Rows_log_event::find_row() function, which
causes an error to be returned for this case.
This patch fixes the problem by adding code to either ignore the
record and continuing with the next one, the the event of a table
scan, or change the error code to HA_ERR_KEY_NOT_FOUND, in the event
that a key lookup is attempted.
The code to get read the value of a system variable was extracting its value
on PREPARE stage and was substituting the value (as a constant) into the parse tree.
Note that this must be a reversible transformation, i.e. it must be reversed before
each re-execution.
Unfortunately this cannot be reliably done using the current code, because there are
other non-reversible source tree transformations that can interfere with this
reversible transformation.
Fixed by not resolving the value at PREPARE, but at EXECUTE (as the rest of the
functions operate). Added a cache of the value (so that it's constant throughout
the execution of the query). Note that the cache also caches NULL values.
Updated an obsolete related test suite (variables-big) and the code to test the
result type of system variables (as per bug 74).
mysql-test/extra/rpl_tests/rpl_insert_id.test:
Bug #32124: removed ambiguous testcase
mysql-test/r/innodb_data_home_dir_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/innodb_flush_method_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/ps_11bugs.result:
Bug #32124: test case
mysql-test/r/ssl_capath_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/ssl_cipher_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/variables.result:
Bug #32124: system vars are shown as such in EXPLAIN EXTENDED, not as constants.
mysql-test/suite/rpl/r/rpl_insert_id.result:
Bug #32124: removed ambiguous testcase
mysql-test/t/ps_11bugs.test:
Bug #32124: test case
sql/item.cc:
Bug #32124: placed the code to convert string to longlong or double
to a function (so that it can be reused)
sql/item.h:
Bug #32124: placed the code to convert string to longlong or double
to a function (so that it can be reused)
sql/item_func.cc:
Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/item_func.h:
Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/set_var.cc:
Bug #32124: removed the code that calculated the system variable's value
at PREPARE
sql/set_var.h:
Bug #32124: removed the code that calculated the system variable's value
at PREPARE
tests/mysql_client_test.c:
Bug #32124 : removed the reading of the system variable, because its max
length is depended on the system charset and client charset and can't be
easily calculated.
mysql-test/extra/rpl_tests/rpl_log.test:
Removing extreneous start slave.
Added missing drop of table t1.
mysql-test/suite/rpl/t/rpl_binlog_query_filter_rules.test:
Replaced $MYSQLTEST_VARDIR/log with $MYSQLD_DATADIR
mysql-test/suite/rpl/t/rpl_misc_functions.test:
Using temporary table instead to remove need for drop table.
The Blackhole engine did not support row-based replication
since the delete_row(), update_row(), and the index and range
searching functions were not implemented.
This patch adds row-based replication support for the
Blackhole engine by implementing the two functions mentioned
above, and making the engine pretend that it has found the
correct row to delete or update when executed from the slave
SQL thread by implementing index and range searching functions.
It is necessary to only pretend this for the SQL thread, since
a SELECT executed on the Blackhole engine will otherwise never
return EOF, causing a livelock.
mysql-test/extra/binlog_tests/blackhole.test:
Blackhole now handles row-based replication.
mysql-test/extra/rpl_tests/rpl_blackhole.test:
Test helper file for testing that blackhole actually
writes something to the binary log on the slave.
mysql-test/suite/binlog/t/binlog_multi_engine.test:
Replication now handles row-based replcation.
mysql-test/suite/rpl/t/rpl_blackhole.test:
Test that Blackhole works with primary key, index, or none.
sql/log_event.cc:
Correcting code to only touch filler bits and leave
all other bits alone. It is necessary since there is
no guarantee that the engine will be able to fill in
the bits correctly (e.g., the blackhole engine).
storage/blackhole/ha_blackhole.cc:
Adding definitions for update_row() and delete_row() to return OK
when executed from the slave SQL thread with thd->query == NULL
(indicating that row-based replication events are being processed).
Changing rnd_next(), index_read(), index_read_idx(), and
index_read_last() to return OK when executed from the slave SQL
thread (faking that the row has been found so that processing
proceeds to update/delete the row).
storage/blackhole/ha_blackhole.h:
Enabling row capabilities for engine.
Defining write_row(), update_row(), and delete_row().
Making write_row() private (as it should be).
The size of the Innodb_buffer_pool_pages differs by one byte on row versus statement
log, so neuter the last position of the stringified decimal representation. Innobase
says the size isn't very important in any case.
Also, split out the "mixed" format to its own file, as mtr seems to dislike having only
stm and row but not mix.
The assertion indicates that some data was left in the transaction
cache when the server was shut down, which means that a previous
statement did not commit or rollback correctly.
What happened was that a bug in the rollback of a transactional
table caused the transaction cache to be emptied, but not reset.
The error can be triggered by having a failing UPDATE or INSERT,
on a transactional table, causing an implicit rollback.
Fixed by always flushing the pending event to reset the state
properly.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Testing that a failed update (that writes some rows to the
transaction cache) does not cause the transaction cache to
hold on to the data or forget to reset the transaction cache.
sql/log.cc:
Added call to remove pending event when the transaction cache
is emptied instead of written to binary log. The call will also
clear the outstanding table map count so that the cache is not
left it in a state of "empty but not reset".
Added function MYSQL_BIN_LOG::remove_pending_rows_event().
sql/log.h:
Added function MYSQL_BIN_LOG::remove_pending_rows_event().
sql/sql_class.cc:
Adding function THD::binlog_remove_pending_rows_event().
sql/sql_class.h:
Adding function THD::binlog_remove_pending_rows_event().
tables open
When executing a DROP DATABASE statement in ROW mode and having temporary
tables open at the same time, the existance of temporary tables prevent
the server from switching back to row mode after temporarily switching to
statement mode to handle the logging of the statement.
Fixed the problem by removing the code to switch to statement mode and added
code to temporarily disable the binary log while dropping the objects in the
database.
mysql-test/extra/binlog_tests/database.test:
Added test to ensure that DROP DATABASE does not affect the replication mode.
sql/sql_db.cc:
Removed code that clears the current_stmt_binlog_row_based flag.
Added code to disable the binary log while dropping the objects
in a database.
When executing a DROP DATABASE statement in ROW mode and having temporary
tables open at the same time, the existance of temporary tables prevent
the server from switching back to row mode after temporarily switching to
statement mode to handle the logging of the statement.
Fixed the problem by removing the code to switch to statement mode and added
code to temporarily disable the binary log while dropping the objects in the
database.
mysql-test/extra/binlog_tests/database.test:
Added test to ensure that DROP DATABASE does not affect the replication mode.
mysql-test/suite/binlog/r/binlog_database.result:
Result file change.
sql/sql_db.cc:
Removed code that clears the current_stmt_binlog_row_based flag.
Added code to disable the binary log while dropping the objects
in a database.
manually resolved conflicts:
Text conflict in client/mysqltest.c
Contents conflict in mysql-test/include/have_bug25714.inc
Text conflict in mysql-test/include/have_ndbapi_examples.inc
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/suite/parts/inc/partition_check_drop.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check1.inc
Text conflict in mysql-test/suite/parts/inc/partition_layout_check2.inc
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_1_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter1_2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter2_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_alter3_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_innodb.result
Text conflict in mysql-test/suite/parts/r/partition_basic_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_basic_symlink_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_engine_myisam.result
Text conflict in mysql-test/suite/parts/r/partition_syntax_myisam.result
Text conflict in mysql-test/suite/rpl_ndb/t/disabled.def
Text conflict in mysql-test/t/disabled.def
Problem: binlog_stm_binlog runs INSERT DELAYED queries, and
then prints the contents of the binlog. Before checking the
contents of the binlog, the test waits until the rows have
appeared in the table. However, this is not enough, since
INSERT DELAYED does not write rows to the binlog at the same
time as it writes them to the table. So there is a race.
Fix: Add a FLUSH TABLES before SHOW BINLOG EVENTS. That
waits until the insert_delayed thread is done.
mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
- Added FLUSH TABLES, so that SHOW BINLOG EVENTS becomes
deterministic.
- Added comments.
- Removed unnecessary 'set @@session.auto_increment_increment'
statements.
- Removed unnecessary check that the number of rows inserted
to the table is 11.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
updated result file
BUG#37884: rpl_row_basic_2myisam and rpl_row_basic_3innodb fail sporadically in pushbuild
These have been fixed in 5.1-rpl. Re-applying fix for BUG#37884
in 5.1-bugteam, and disabling rpl_flushlog_loop for BUG#37733 in
5.1-bugteam.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Missing sync_slave_with_master added.
mysql-test/suite/rpl/t/disabled.def:
Disabling rpl_flushlog_loop until the fixed version gets
merged from 5.1-rpl
Problem 1: tests often fail in pushbuild with a timeout when waiting
for the slave to start/stop/receive error.
Fix 1: Updated the wait_for_slave_* macros in the following way:
- The timeout is increased by a factor ten
- Refactored the macros so that wait_for_slave_param does the work for
the other macros.
Problem 2: Tests are often incorrectly written, lacking a
source include/wait_for_slave_to_[start|stop].inc.
Fix 2: Improved the chance to get it right by adding
include/start_slave.inc and include/stop_slave.inc, and updated tests
to use these.
Problem 3: The the built-in test language command
wait_for_slave_to_stop is a misnomer (does not wait for the slave io
thread) and does not give as much debug info in case of failure as
the otherwise equivalent macro
source include/wait_for_slave_sql_to_stop.inc
Fix 3: Replaced all calls to the built-in command by a call to the
macro.
Problem 4: Some, but not all, of the wait_for_slave_* macros had an
implicit connection slave. This made some tests confusing to read,
and made it more difficult to use the macro in circular replication
scenarios, where the connection named master needs to wait.
Fix 4: Removed the implicit connection slave from all
wait_for_slave_* macros, and updated tests to use an explicit
connection slave where necessary.
Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc
were unused. Moreover, using them is difficult and error-prone.
Fix 5: remove these macros.
Problem 6: log_bin_trust_function_creators_basic failed when running
tests because it assumed @@global.log_bin_trust_function_creators=1,
and some tests modified this variable without resetting it to its
original value.
Fix 6: All tests that use this variable have been updated so that
they reset the value at end of test.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Replaced wait_for_slave_to_stop by include/wait_for_slave_sql_to_stop.inc
Added connection slave since includ/wait_for_slave_sql_to_stop.inc
does not do that anymore.
mysql-test/extra/rpl_tests/rpl_log.test:
Replaced start slave+wait_slave_status by start_slave.inc
mysql-test/include/reset_master_and_slave.inc:
replaced start/stop slave by start_slave.inc/stop_slave.inc
mysql-test/include/sync_slave_io_with_master.inc:
Improved comments and error message.
mysql-test/include/wait_for_slave_io_to_stop.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_for_slave_param.inc:
- Improved usage instructions
- Added more debug info in case of timeout
- Added parameters $slave_param_comparison, $slave_timeout,
$slave_keep_connection, $slave_error_message
mysql-test/include/wait_for_slave_sql_error.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_for_slave_sql_to_start.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_for_slave_sql_to_stop.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_for_slave_to_start.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_for_slave_to_stop.inc:
Refactored to use wait_for_slave_param.inc.
Removed connection slave.
mysql-test/include/wait_show_pattern.inc:
Removed unused (and error-prone) file
mysql-test/include/wait_slave_status.inc:
Removed unused (and error-prone) file
mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test:
Renamed $keep_connection to $slave_keep_connection.
mysql-test/suite/rpl/t/rpl_bug26395.test:
Replace stop slave by stop_slave.inc
mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test:
Replace start/stop slave by start_slave.inc/stop_slave.inc.
Replace wait_for_slave_param by wait_for_slave_sql_to_stop.inc.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Renamed $keep_connection to $slave_keep_connection.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
Replace wait_slave_status by start_slave.inc
mysql-test/suite/rpl/t/rpl_idempotency.test:
Added connection slave since wait_for_slave_sql_to_stop.inc does not
do that any more.
mysql-test/suite/rpl/t/rpl_incident.test:
Replaced wait_for_slave_to_stop by wait_for_slave_sql_to_stop.inc
mysql-test/suite/rpl/t/rpl_init_slave.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
Replaced save_master_pos;connection slave;sync_with_master by
sync_slave_with_master.
mysql-test/suite/rpl/t/rpl_log_pos.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
Replaced wait_for_slave_param by other wait_for_slave_* macros.
mysql-test/suite/rpl/t/rpl_packet.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_row_until.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
Replaced save_master_pos;connection slave;sync_with_master by
sync_slave_with_master.
mysql-test/suite/rpl/t/rpl_server_id1.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_grp_exec.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_slave_status.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/suite/rpl/t/rpl_sp.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/suite/rpl/t/rpl_sp_effects.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/suite/rpl/t/rpl_stm_until.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
Replaced save_master_pos;connection slave;sync_with_master by
sync_slave_with_master.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Replaced start slave by start_slave.inc.
Added explicit connection slave since wait_for_slave_sql_to_stop.inc
does not do that anymore.
mysql-test/t/disabled.def:
Disabled failing test.
mysql-test/t/func_time.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/grant.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/grant2.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/innodb_notembedded.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/log_bin_trust_function_creators_func.test:
Restore @@global.log_bin_trust_function_creators at end of test.
Clean up at end of test by dropping the created user.
mysql-test/t/query_cache.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/query_cache_notembedded.test:
Restore @@global.log_bin_trust_function_creators at end of test.
mysql-test/t/rpl_init_slave_func.test:
Replaced start/stop slave by start_slave.inc/stop_slave.inc.
mysql-test/t/timezone2.test:
Restore @@global.log_bin_trust_function_creators at end of test.
In order to handle CHAR() fields, 8 bits were reserved for
the size of the CHAR field. However, instead of denoting the
number of characters in the field, field_length was used which
denotes the number of bytes in the field.
Since UTF-8 fields can have three bytes per character (and
has been extended to have four bytes per character in 6.0),
an extra two bits have been encoded in the field metadata
work for fields of type Field_string (i.e., CHAR fields).
Since the metadata word is filled, the extra bits have been
encoded in the upper 4 bits of the real type (the most
significant byte of the metadata word) by computing the
bitwise xor of the extra two bits. Since the upper 4 bits
of the real type always is 1111 for Field_string, this
means that for fields of length <256, the encoding is
identical to the encoding used in pre-5.1.26 servers, but
for lengths of 256 or more, an unrecognized type is formed,
causing an old slave (that does not handle lengths of 256
or more) to stop.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Adding test cases for replicating UTF-8 fields of lengths
of 256 or more (bytes).
mysql-test/suite/binlog/r/binlog_base64_flag.result:
Result file change.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
Adding tests to trigger check that an error is generated when replicating from a
5.1.25 server for tables with a CHAR(128) but not when replicating a table with a
CHAR(63). Although the bug indicates that the limit is 83, we elected to use CHAR(63)
since 6.0 uses 4-byte UTF-8, and anything exceeding 63 would then cause the test to fail
when the patch is merged to 6.0.
mysql-test/suite/bugs/combinations:
Adding combinations file to run all bug reports in all binlog modes (where
applicable).
mysql-test/suite/bugs/r/rpl_bug37426.result:
Result file change.
mysql-test/suite/bugs/t/rpl_bug37426.test:
Added test for reported bug.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
Result file change.
sql/field.cc:
Encoding an extra two bits in the most significant nibble (4 bits)
of the metadata word. Adding assertions to ensure that no attempt
is made to use lengths longer than supported.
Extending compatible_field_size() function with an extra parameter
holding a Relay_log_instace for error reporting.
Field_string::compatible_field_size() now reports an error if field
size for a CHAR is >255.
sql/field.h:
Field length is now computed from most significant 4 bits
of metadata word, or is equal to the row pack length if
there is no metadata.
Extending compatible_field_size() function with an extra parameter
holding a Relay_log_instace for error reporting.
sql/rpl_utility.cc:
Adding relay log parameter to compatible_field_size().
Minor refactoring to eliminate duplicate code.
sql/slave.cc:
Extending rpl_master_has_bug() with a single-argument predicate function and
a parameter to the predicate function. The predicate function can be used to
test for extra conditions for the bug before writing an error message.
sql/slave.h:
Extending rpl_master_has_bug() with a single-argument predicate function and
a parameter to the predicate function. The predicate function can be used to
test for extra conditions for the bug before writing an error message.
Also removing gratuitous default argument.
sql/sql_insert.cc:
Changing calls to rpl_master_has_bug() to adapt to changed signature.
replicated correctly between machines with
mixed endiannes
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Added regression test for bug#37076.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
Added regression test for bug#37076.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
Added regression test for bug#37076.
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
Added regression test for bug#37076.
sql/field.h:
Fixed bug #37076: TIMESTAMP/DATETIME/DATE values are not
replicated correctly between machines with
mixed endiannes
pack and unpack virtual methods have been overloaded for
Field_timestamp (TIMESTAMP domain), Field_datetime (DATETIME
domain) and Field_date (DATE domain) classes to replicate data
between platforms with different endiannes in a correct way
like in Field_long and Field_longlong classes.
Common code have been moved to private handle_int32 and
handle_int64 private methods.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
Moving save and restore of @@global.concurrent_insert into the same
session thread.
mysql-test/suite/rpl/r/rpl_insert_id.result:
Result file change.
mysql-test/suite/rpl/t/rpl_insert_id.test:
***MISSING TEXT***
Problem: If INSERT is immediately followed by SELECT in another thread,
the newly inserted rows may not be returned by the SELECT statement, if
ENGINE=myisam and @@concurrent_insert=1. This caused sporadic errors in
rpl_insert_id.
Fix: The test now uses ENGINE=$engine_type when creating tables (so that
innodb is used). It also turns off @@concurrent_insert around the critical
place, so that it works if someone in the future writes a test that sets
$engine_type=myisam before sourcing extra/rpl_tests/rpl_insert_id.test.
It also adds ORDER BY to all SELECTs so that the result is deterministic.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
- Use ENGINE=$engine_type when creating tables, since that's expected by
suite/rpl/t/rpl_insert_id.test.
- Use ORDER BY to avoid nondeterministic results from SELECT.
- Set @@concurrent_insert=0 before doing SELECT after INSERT in another
client.
mysql-test/suite/rpl/r/rpl_insert_id.result:
Update result file.
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-rpl_row_charset.test:
Auto merged
CMakeLists.txt:
Auto merged
configure.in:
Auto merged
client/mysqltest.c:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
mysql-test/include/commit.inc:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/lib/mtr_report.pm:
Auto merged
mysql-test/r/commit_1innodb.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/ctype_big5.result:
Auto merged
mysql-test/r/drop.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/loaddata.result:
Auto merged
mysql-test/r/mysqlbinlog.result:
Auto merged
mysql-test/r/partition_error.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/binlog/r/binlog_unsafe.result:
Auto merged
mysql-test/suite/binlog/t/binlog_unsafe.test:
Auto merged
mysql-test/suite/federated/federated.result:
Auto merged
mysql-test/suite/federated/federated.test:
Auto merged
mysql-test/suite/parts/r/partition_alter1_myisam.result:
Auto merged
mysql-test/suite/parts/r/partition_alter2_myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_log.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
Auto merged
mysql-test/suite/rpl/t/disabled.def:
Auto merged
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
Auto merged
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/csv.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/distinct.test:
Auto merged
mysql-test/t/drop.test:
Auto merged
mysql-test/t/group_by.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/loaddata.test:
Auto merged
mysql-test/t/partition_error.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysql-test/t/warnings.test:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
BitKeeper/deleted/.del-combinations:
Delete: mysql-test/suite/binlog/combinations
mysql-test/r/partition_not_windows.result:
Use remote
mysql-test/r/partition_symlink.result:
Use remote
mysql-test/r/symlink.result:
SCCS merged
mysql-test/suite/parts/inc/partition_basic.inc:
SCCS merged
mysql-test/suite/parts/inc/partition_check_drop.inc:
Use remote
mysql-test/suite/parts/inc/partition_layout_check1.inc:
Use remote
mysql-test/suite/parts/inc/partition_layout_check2.inc:
Use remote
mysql-test/suite/parts/r/partition_basic_innodb.result:
Use remote
mysql-test/suite/parts/r/partition_basic_myisam.result:
Use remote
mysql-test/suite/parts/r/partition_engine_myisam.result:
Use remote
mysql-test/suite/parts/t/partition_sessions.test:
SCCS merged
mysql-test/t/partition.test:
SCCS merged
mysql-test/t/partition_not_windows.test:
Use remote
mysql-test/t/partition_symlink.test:
Use remote
mysql-test/t/symlink.test:
Use remote
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Manual merge, name of binlog file changed
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
Manual merge
mysys/my_init.c:
Manual merge
into magare.gmz:/home/kgeorge/mysql/work/merge-build-5.1-bugteam
sql/log.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/share/errmsg.txt:
merged 5.1-main to 5.1-bugteam
into mats-laptop.(none):/home/bk/b29020-mysql-5.1-rpl
mysql-test/suite/binlog/r/binlog_base64_flag.result:
Auto merged
mysql-test/suite/binlog/t/binlog_base64_flag.test:
Auto merged
mysql-test/suite/rpl/r/rpl_row_create_table.result:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/sql_insert.cc:
Auto merged
The bug allow multiple executing transactions working with non-transactional
to interfere with each others by interleaving the events of different trans-
actions.
Bug is fixed by writing non-transactional events to the transaction cache and
flushing the cache to the binary log at statement commit. To mimic the behavior
of normal statement-based replication, we flush the transaction cache in row-
based mode when there is no committed statements in the transaction cache,
which means we are committing the first one. This means that it will be written
to the binary log as a "mini-transaction" with just the rows for the statement.
Note that the changes here does not take effect when building the server with
HAVE_TRANSACTIONS set to false, but it is not clear if this was possible before
this patch either.
For row-based logging, we also have that when AUTOCOMMIT=1, the code now always
generates a BEGIN/COMMIT pair for single statements, or BEGIN/ROLLBACK pair in the
case of non-transactional changes in a statement that was rolled back. Note that
for the case where changes to a non-transactional table causes a rollback due
to error, the statement will now be logged with a BEGIN/ROLLBACK pair, even
though some changes has been committed to the non-transactional table.
mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test:
Removing SHOW BINLOG EVENTS causing test to be non-deterministic.
mysql-test/r/ctype_cp932_binlog_row.result:
Result change.
mysql-test/suite/binlog/r/binlog_base64_flag.result:
Result change.
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Result file change.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Result file change.
mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result:
Result file change.
mysql-test/suite/binlog/r/binlog_row_insert_select.result:
Result file change.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Result file change.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Result file change.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
Removing table that will be used in test to prevent failing if preceeding
tests forgot to drop the table.
mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_create_table.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_delayed_ins.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_log.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_until.result:
Result file change.
mysql-test/suite/rpl/r/rpl_slave_skip.result:
Result file change.
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
Result file change.
mysql-test/suite/rpl/r/rpl_truncate_2myisam.result:
Result file change.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Binlog position change.
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
Binlog position change.
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
Binlog position change. Added stop position to mysqlbinlog argments to prevent
extreneous output.
mysql-test/suite/rpl/t/rpl_row_until.test:
Binlog position change.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Binlog position change.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Removing extreneous SHOW BINLOG EVENTS causing test to be non-deterministic.
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
Result change.
sql/log.cc:
Adding variable at_least_one_stmt to denote that there is at least one
statement committed to the transaction cache (but there might be more).
Removing duplicate checks from binlog_end_trans(). The transaction cache
should always be committed or rolled back when this function is called.
Correcting conditions for binlog_rollback() and binlog_commit() and removing
the previous "invisible commit" in favor of always using explicit commits
in the binary log.
sql/log_event.cc:
Marking table map event to be cached. Removing Muted_query_log_event from code.
sql/log_event.h:
Removing unused class Muted_query_log_event.
sql/sql_insert.cc:
Adding missing call to ha_autocommit_or_rollback() for delayed thread. Marking
CREATE-SELECT statements as transactional, since they don't need to be logged.
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
client/mysqltest.c:
Auto merged
configure.in:
Auto merged
mysql-test/extra/rpl_tests/rpl_loaddata.test:
Auto merged
mysql-test/extra/rpl_tests/rpl_log.test:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/lib/mtr_report.pm:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/mysqlbinlog.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
Auto merged
mysql-test/suite/rpl/t/disabled.def:
Auto merged
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
mysql-test/mysql-test-run.pl:
Use local
mysql-test/r/type_blob.result:
Manual merge
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Manual merge
mysql-test/suite/binlog/r/binlog_unsafe.result:
Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
Manual merge
mysql-test/suite/rpl/r/rpl_loaddata.result:
Manual merge
mysql-test/t/mysqlbinlog2.test:
Manual merge
mysql-test/extra/rpl_tests/rpl_loaddata.test:
Removing SHOW MASTER STATUS that does not seem to make sense.
mysql-test/extra/rpl_tests/rpl_log.test:
Correcting test case to sync slave with master.
mysql-test/suite/binlog/r/binlog_unsafe.result:
Result change.
mysql-test/suite/binlog/t/binlog_unsafe.test:
Removing unsafe variable from list of safe variables.
mysql-test/suite/rpl/r/rpl_loaddata.result:
Result change.
mysql-test/suite/rpl/r/rpl_skip_error.result:
Result change.
mysql-test/suite/rpl/t/rpl_skip_error.test:
Correcting bad manual+automatic merge. Test is now only relevant for statement-
based replication.
sql/rpl_rli.cc:
Correcting automerge undoing previous change of return value.
Relay_log_info::wait_for_pos() should return -2 when not initialized to work
correctly.
There was a failure in that show slave status displayed a wrong message
when slave stopped at processing a row event inserting to a default-less
column.
The problem seem to have ceased after recent fixes in rbr code.
However, the test was not updated to carry testing of the case commented-out.
Uncommenting and editing the test.
Notice, Bug#23907 is most probably a duplicate of this one.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
uncommenting the test that previously failed.
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
results changed due to the correct expected error message of an added test
is displayed.
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
results changed to reflect the test changes
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
results changed to reflect the uncommented test
sql/log_event.cc:
correcting of a merge with bug#12713 to use the correct object holding
the error code.
Add missing drop view
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Look for binlog in mysqlds datadir
Update path to std-data
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Update result
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Update result
mysql-test/suite/binlog/r/binlog_unsafe.result:
Add missing drop view
mysql-test/suite/binlog/t/binlog_unsafe.test:
Add missing drop view
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-rpl_row_charset.test:
Auto merged
BitKeeper/deleted/.del-rpl_row_charset_innodb.test:
Auto merged
CMakeLists.txt:
Auto merged
client/mysqltest.c:
Auto merged
configure.in:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/ctype_big5.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/mysqlbinlog.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/system_mysql_db.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/suite/federated/federated.result:
Auto merged
mysql-test/suite/federated/federated.test:
Auto merged
mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result:
Auto merged
mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result:
Auto merged
mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test:
Auto merged
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_timezone.result:
Auto merged
mysql-test/suite/rpl/t/rpl_load_from_master.test:
Auto merged
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Auto merged
mysql-test/suite/rpl/t/rpl_trigger.test:
Auto merged
mysql-test/t/csv.test:
Auto merged
mysql-test/t/ctype_big5.test:
Auto merged
mysql-test/t/gis.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/system_mysql_db_fix50117.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
mysql-test/t/trigger_notembedded.test:
Auto merged
mysql-test/t/type_blob.test:
Auto merged
mysql-test/t/view.test:
Auto merged
mysql-test/t/warnings.test:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
mysql-test/Makefile.am:
SCCS merged
mysql-test/mysql-test-run.pl:
Use local version of mtr.pl
mysql-test/lib/mtr_cases.pm:
Use local mtr_cases.pm
mysql-test/suite/rpl/t/disabled.def:
Use remote disabled file
mysql-test/t/disabled.def:
Use remote disabled file
sql/ha_ndbcluster_binlog.cc:
Use remote
mysql-test/extra/rpl_tests/rpl_charset.test:
Manual merge
mysql-test/lib/mtr_report.pm:
Manual merge
mysql-test/suite/binlog/r/binlog_killed_simulate.result:
Manual merge
mysql-test/suite/binlog/r/binlog_multi_engine.result:
Manual merge
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Manual merge
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Manual merge
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Manual merge
mysql-test/suite/binlog/t/binlog_killed.test:
Manual merge
mysql-test/suite/binlog/t/binlog_killed_simulate.test:
Manual merge
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
Manual merge
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
Manual merge
mysql-test/suite/ndb/r/ndb_binlog_format.result:
Manual merge
mysql-test/suite/ndb/r/ndb_restore.result:
Manual merge
mysql-test/suite/ndb/t/ndb_restore.test:
Manual merge
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Manual merge
mysql-test/suite/rpl/r/rpl_stm_log.result:
Manual merge
mysql-test/suite/rpl/t/rpl_row_sp005.test:
Manual merge
mysql-test/t/log_state.test:
Manual merge
mysql-test/t/mysqlbinlog.test:
Manual merge
mysql-test/t/mysqlbinlog2.test:
Manual merge
mysql-test/t/upgrade.test:
Manual merge
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
The test unnecessarily refused to run in non-debug mode. It can safely
run in non-debug mode and produces the same result, so I removed the
restriction.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Updated result file. It is a little unclear what the best thing to put in
the binlog is, but the present results for this particular test are enough
to replicate. Mats will figure out more as he fixes BUG#29020. After
BUG#34768 has been fixed, these statements should be marked unsafe and
not allowed in statement mode.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Updated result file. It is a little unclear what the best thing to put in
the binlog is, but the present results for this particular test are enough
to replicate. Mats will figure out more as he fixes BUG#29020. After
BUG#34768 has been fixed, these statements should be marked unsafe and
not allowed in statement mode.
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
mysql-test/extra/binlog_tests/ctype_cp932.test:
Auto merged
mysql-test/r/ctype_euckr.result:
Auto merged
mysql-test/r/ctype_sjis.result:
Auto merged
mysql-test/r/ctype_uca.result:
Auto merged
mysql-test/r/ctype_ujis.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result:
Auto merged
mysql-test/t/ctype_sjis.test:
Auto merged
mysql-test/t/ctype_uca.test:
Auto merged
mysql-test/t/ctype_ujis.test:
Auto merged
strings/ctype-euc_kr.c:
Auto merged
strings/ctype-eucjpms.c:
Auto merged
strings/ctype-gb2312.c:
Auto merged
strings/ctype-ucs2.c:
Auto merged
strings/ctype-ujis.c:
Auto merged
mysql-test/r/ctype_ucs.result:
SCCS merged
mysql-test/t/ctype_ucs.test:
SCCS merged
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/slave.cc:
Auto merged
irrelevant to execute since the charset information does not
affect replication for row-based replication. The row-based
versions of the tests were removed, and the statement-based
version of the test was made executable by all three modes.
This involves removing any lines that causes the test to be
dependent on the contents of the binary log, and instead we
just check that the replication works as it should.
BitKeeper/deleted/.del-rpl_ndb_charset.test:
Delete: mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test
BitKeeper/deleted/.del-rpl_ndb_charset.result:
Delete: mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result
BitKeeper/deleted/.del-rpl_row_charset.test:
Delete: mysql-test/extra/rpl_tests/rpl_row_charset.test
BitKeeper/deleted/.del-rpl_row_charset.test~739be9df1baaee3e:
Delete: mysql-test/suite/rpl/t/rpl_row_charset.test
BitKeeper/deleted/.del-rpl_row_charset_innodb.test:
Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb.test
BitKeeper/deleted/.del-rpl_row_charset_innodb-master.opt:
Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt
BitKeeper/deleted/.del-rpl_row_charset_innodb-slave.opt:
Delete: mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt
BitKeeper/deleted/.del-rpl_row_charset_innodb.result:
Delete: mysql-test/suite/rpl/r/rpl_row_charset_innodb.result
BitKeeper/deleted/.del-rpl_row_charset.result:
Delete: mysql-test/suite/rpl/r/rpl_row_charset.result
mysql-test/extra/rpl_tests/rpl_charset.test:
Test is not dependent on binlog format any more.
Using --echo instead of "select" to print text.
Removing lines causing the test to be dependent on binlog contents.
mysql-test/suite/rpl/r/rpl_charset.result:
Result change.
mysql-test/suite/rpl/t/rpl_charset.test:
Using renamed version of test file.
rpl_ndb_rep_ignore
Reason: previous test, rpl_ndb_2multi_eng, does not sync slave with master
after cleanup, so tables are sometimes left on slave
Fix: sync_slave_with_master
mysql-test/extra/rpl_tests/rpl_ndb_2multi_eng.test:
Wait until drop table is replicated to slave before terminating. (The
extra table caused sporadic errors in the next test case, causing
pushbuild to fail.)
into dipika.(none):/opt/local/work/mysql-5.1-runtime
include/my_sys.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_view.cc:
Auto merged
mysql-test/extra/binlog_tests/binlog.test:
Manual merge of binlog test case for Bug#33798
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Add test case result for Bug#33798
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Add test case result for Bug#33798
sql/item.cc:
Use new method which accepts a unsigned flag.
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
include/my_base.h:
Auto merged
mysql-test/include/show_binlog_events2.inc:
Auto merged
mysql-test/suite/binlog/t/binlog_old_versions.test:
Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Auto merged
mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt:
Auto merged
mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt:
Auto merged
sql/log_event_old.cc:
Auto merged
sql/sql_binlog.cc:
Auto merged
mysql-test/suite/rpl/r/rpl_loaddata_map.result:
Manual merge.
mysql-test/suite/rpl/r/rpl_user.result:
Manual merge.
mysql-test/suite/rpl/t/rpl_loaddata_map.test:
Manual merge.
mysql-test/suite/rpl/t/rpl_user.test:
Manual merge.
sql/log_event.cc:
Manual merge.
sql/rpl_record.cc:
Manual merge.
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
BitKeeper/deleted/.del-binlog_start_comment.test:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Auto merged
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
client/client_priv.h:
Auto merged
include/my_sys.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_view.cc:
Auto merged
mysql-test/suite/rpl/r/rpl_invoked_features.result:
Manual merge.
mysql-test/suite/rpl/t/rpl_invoked_features.test:
Manual merge.
sql/log.cc:
Manual merge.
into mysql1000.(none):/home/andrei/MySQL/FIXES/5.1/bug32971-rbr_error_prop
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
manual merge use local
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
manual merge use local
The error message due to lack of the default value for an extra field
was not as informative as it should be.
Fixed with improving the scheme of gathering, propagating and reporting
errors in applying rows events.
The scheme is in the following.
Any kind of error of processing of a row event incidents are to be
registered with my_error().
In the end Rows_log_event::do_apply_event() invokes rli->report() with the
message to display consisting of all the errors.
This mimics `show warnings' displaying.
A simple test checks three errors in processing an event.
Two hunks - a user level error and pushing it into the list -
have been devoted to already fixed Bug@31702.
Some open issues relating to this artifact listed on BUG@21842 page and
on WL@3679.
Todo: to synchronize the statement in the tests comments on Update and Delete
events may not stop when an extra field does not have a default with wl@3228 spec.
include/my_base.h:
A new handler level error code that is supposed to be mapped to a set of more
specific ER_ user level errors.
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Adding yet another extra fields to see more than one error in show
slave status' report.
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
results changed (the error message etc)
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
results changed
sql/log_event.cc:
Refining slave_rows_error_report to iterate on the list of gathered errors;
Simplifying signature of prepare_record as the function does not call
rli->report to leave that duty to the event's top level code.
sql/log_event.h:
adding a corrupt event error pushing. The error will be seen with
show slave status.
sql/log_event_old.cc:
similar to log_event.cc changes
sql/rpl_record.cc:
prepare_record only pushes an error to the list
sql/rpl_record.h:
signature changed
sql/share/errmsg.txt:
The user level error code that corresponds to HA_ERR_CORRUPT_EVENT.
The error will be reported in show slave status if such a failure happens.
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
BitKeeper/deleted/.del-binlog_start_comment.result:
Auto merged
include/my_sys.h:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Auto merged
mysql-test/r/case.result:
Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Auto merged
mysql-test/suite/rpl/r/rpl_000015.result:
Auto merged
mysql-test/suite/rpl/t/rpl_000015.test:
Auto merged
mysql-test/t/case.test:
Auto merged
sql/log_event.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
BitKeeper/deleted/.del-binlog_start_comment.test:
Using remote file.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Manual merge. Taking remote file to update result set after merge,
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Manual merge.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Manual merge.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Remove unnecessary show master status, and replace the rest with show binlog events for checking
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
update result
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
update result
mysql-test/extra/binlog_tests/blackhole.test:
mask out file_id
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test:
remove unnecessary show master status
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
mask out file_id
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
remove unnecessary show master status
into mail.hezx.com:/media/sda3/work/mysql/bkwork/versional/merge-51
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
mask error message in show slave status
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Mask out error messages
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Mask out Error messages in reslut of show slave status
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Mask out Error messages in reslut of show slave status
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
mask out binlog position
into mail.hezx.com:/media/sda3/work/mysql/bkwork/versional/merge-51
mysql-test/suite/rpl/r/rpl_create_database.result:
Auto merged
mysql-test/suite/rpl/r/rpl_load_from_master.result:
Auto merged
mysql-test/suite/rpl/t/rpl_create_database.test:
Auto merged
mysql-test/suite/rpl/t/rpl_load_from_master.test:
Auto merged
mysql-test/suite/rpl/r/rpl_init_slave.result:
SCCS merged
mysql-test/suite/rpl/t/rpl_init_slave.test:
SCCS merged
Mask binlog positions, error, warning and other information that are not significant for the test
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
Mask out binlog position and DBs in result of show master status
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Mask out log positions in tests to make them version independent
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Mask out Error messages in reslut of show slave status
mysql-test/suite/rpl/r/rpl_000015.result:
Mask out log positions in tests to make them version independent
---
Mask out binlog position and DBs in result of show master status
mysql-test/suite/rpl/r/rpl_change_master.result:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/r/rpl_create_database.result:
fix for versional test
mysql-test/suite/rpl/r/rpl_grant.result:
fix for versional test
mysql-test/suite/rpl/r/rpl_init_slave.result:
fix for versional test
mysql-test/suite/rpl/r/rpl_load_from_master.result:
update result
mysql-test/suite/rpl/r/rpl_log_pos.result:
Mask out binlog position and DBs in result of show master status
mysql-test/suite/rpl/r/rpl_rotate_logs.result:
Mask out binlog position and DBs in result of show master status
mysql-test/suite/rpl/r/rpl_row_max_relay_size.result:
Mask out binlog position and DBs in result of show master status
mysql-test/suite/rpl/r/rpl_row_reset_slave.result:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/r/rpl_skip_error.result:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result:
Mask out log positions in tests to make them version independent
---
Mask out binlog position and DBs in result of show master status
mysql-test/suite/rpl/r/rpl_stm_reset_slave.result:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/r/rpl_stm_until.result:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
Mask out binlog positions
mysql-test/suite/rpl/t/rpl_000015.test:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/t/rpl_change_master.test:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/t/rpl_colSize.test:
fix for versional test
mysql-test/suite/rpl/t/rpl_create_database.test:
fix for versional test
mysql-test/suite/rpl/t/rpl_grant.test:
fix for versional test
mysql-test/suite/rpl/t/rpl_init_slave.test:
fix for versional test
mysql-test/suite/rpl/t/rpl_load_from_master.test:
fix for versional test
mysql-test/suite/rpl/t/rpl_log_pos.test:
Mask out binlog position and DBs
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/t/rpl_skip_error.test:
Mask out log positions in tests to make them version independent
mysql-test/suite/rpl/t/rpl_stm_until.test:
Mask out log positions in tests to make them version independent
mysql-test/include/show_binary_logs.inc:
Mask out log positions in tests to make them version independent
mysql-test/include/show_master_logs.inc:
Mask out log positions in tests to make them version independent
mysql-test/include/show_master_status.inc:
Mask out log positions in tests to make them version independent
---
Mask out binlog position and DBs in result of show master status
mysql-test/include/show_slave_status2.inc:
Mask out log positions in tests to make them version independent
into host.loc:/home/uchum/work/5.1-opt
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Merge with local tree (bug#33699).
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Merge with local tree (bug#33699).
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Fixing test file to use different positions depending
on binlog format.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Result change.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Result change.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Result change.
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
Removing part of test that does not work any more.
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
Removing part of test that does not work any more.
mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result:
Result change.
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test:
Dropping tables on both master and slave, and not only on slave.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Fixing test to use different positions depending on binlog format.
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Result change.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Result change.
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
Removing part of test that does not work any more.
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
Removing part of test that does not work any more.
columns (default datatype value is assigned).
The mysql_update function has been modified to generate
an error when trying to set a NOT NULL field to NULL rather than a warning
in the set_field_to_null_with_conversions function.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Updated test case (for bug#33699).
mysql-test/include/ps_modify.inc:
Updated test case (for bug#33699).
mysql-test/r/auto_increment.result:
Updated test case (for bug#33699).
mysql-test/r/null.result:
Updated test case (for bug#33699).
mysql-test/r/ps_2myisam.result:
Updated test case (for bug#33699).
mysql-test/r/ps_3innodb.result:
Updated test case (for bug#33699).
mysql-test/r/ps_4heap.result:
Updated test case (for bug#33699).
mysql-test/r/ps_5merge.result:
Updated test case (for bug#33699).
mysql-test/r/warnings.result:
Updated test case (for bug#33699).
mysql-test/suite/ndb/r/ps_7ndb.result:
Updated test case (for bug#33699).
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Updated test case (for bug#33699).
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Updated test case (for bug#33699).
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
Updated test case (for bug#33699).
mysql-test/t/auto_increment.test:
Updated test case (for bug#33699).
mysql-test/t/null.test:
Updated test case (for bug#33699).
mysql-test/t/warnings.test:
Updated test case (for bug#33699).
sql/sql_update.cc:
Bug#33699: The mysql_update function has been modified to generate
an error when trying to set a NOT NULL field to NULL rather than
a warning in the set_field_to_null_with_conversions function.
tests/mysql_client_test.c:
Updated test case (for bug#33699).
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge
mysql-test/include/have_multi_ndb.inc:
Auto merged
mysql-test/lib/mtr_cases.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event_old.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/rpl_rli.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_binlog.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_string.cc:
Auto merged
mysql-test/Makefile.am:
SCCS merged
mysql-test/mysql-test-run.pl:
Manual merge.
mysql-test/suite/binlog/t/disabled.def:
Manual merge.
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Manual merge.
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Manual merge.
sql/log_event.cc:
Manual merge.
,
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
BitKeeper/deleted/.del-ctype_ucs_binlog.result~280d136b1a0bcf17:
Auto merged
mysql-test/r/mysqlbinlog.result:
Auto merged
mysql-test/r/user_var-binlog.result:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_stm_charset.result:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Manual merge, using remove version of test.
mysql-test/suite/rpl/r/rpl_timezone.result:
Manual merge.
sql/log_event.cc:
Manual merge
mysql-test/extra/rpl_tests/rpl_row_basic.test:
changes due to the strict mode gets default. This hunk is being added after merging
with changes from another bug fixes.
mysql-test/suite/rpl/r/rpl_ignore_table.result:
results changed
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
results changed
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
results changed
mysql-test/suite/rpl/t/rpl_ignore_table.test:
two queries on mysql db tables are replicated according to binlog_format, ie
in row-based when that is requested. Due to cancelling the idempotent default
row based events that previously exectuted successfully now stop the slave sql
thread.
We have to explicitly request the idempotent slave execution mode.
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result:
results changed. They are being committed only now since there was another
bug which fixes my working clone did not have.
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
results changed
sql/log_event.cc:
typo in manual merge earlier
- dynamic configuration support
- safe process
- cleanups
- create new suite for fedarated
BitKeeper/deleted/.del-basic.test:
Rename: mysql-test/ndb/basic.test -> BitKeeper/deleted/.del-basic.test
BitKeeper/deleted/.del-basic_log.result:
Rename: mysql-test/ndb/basic_log.result -> BitKeeper/deleted/.del-basic_log.result
mysql-test/suite/federated/federated_transactions.result:
Rename: mysql-test/r/federated_transactions.result -> mysql-test/suite/federated/federated_transactions.result
BitKeeper/deleted/.del-have_bug25714.require:
Rename: mysql-test/r/have_bug25714.require -> BitKeeper/deleted/.del-have_bug25714.require
BitKeeper/deleted/.del-kill_master.sh:
Rename: mysql-test/misc/kill_master.sh -> BitKeeper/deleted/.del-kill_master.sh
BitKeeper/deleted/.del-ndb_config_4_node.ini~d8e572e9b68f933a:
Rename: mysql-test/ndb/ndb_config_4_node.ini -> BitKeeper/deleted/.del-ndb_config_4_node.ini~d8e572e9b68f933a
BitKeeper/deleted/.del-restart.result:
Rename: mysql-test/ndb/restart.result -> BitKeeper/deleted/.del-restart.result
mysql-test/suite/federated/federated_cleanup.inc:
Rename: mysql-test/include/federated_cleanup.inc -> mysql-test/suite/federated/federated_cleanup.inc
mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt:
Rename: mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi -> mysql-test/suite/rpl/t/rpl_rotate_logs-slave.opt
BitKeeper/deleted/.del-install_test_db.sh:
Rename: mysql-test/install_test_db.sh -> BitKeeper/deleted/.del-install_test_db.sh
BitKeeper/deleted/.del-ndb_config_1_node.ini~7ec640ed25570e16:
Rename: mysql-test/ndb/ndb_config_1_node.ini -> BitKeeper/deleted/.del-ndb_config_1_node.ini~7ec640ed25570e16
BitKeeper/deleted/.del-mtr_timer.pl:
Rename: mysql-test/lib/mtr_timer.pl -> BitKeeper/deleted/.del-mtr_timer.pl
BitKeeper/deleted/.del-create-test-result:
Rename: mysql-test/create-test-result -> BitKeeper/deleted/.del-create-test-result
BitKeeper/deleted/.del-fix-result:
Rename: mysql-test/fix-result -> BitKeeper/deleted/.del-fix-result
BitKeeper/deleted/.del-mysql-test-run-shell.sh:
Rename: mysql-test/mysql-test-run-shell.sh -> BitKeeper/deleted/.del-mysql-test-run-shell.sh
BitKeeper/deleted/.del-mysql-test_V1.9.pl:
Rename: mysql-test/misc/mysql-test_V1.9.pl -> BitKeeper/deleted/.del-mysql-test_V1.9.pl
BitKeeper/deleted/.del-resolve-stack:
Rename: mysql-test/resolve-stack -> BitKeeper/deleted/.del-resolve-stack
BitKeeper/deleted/.del-restart_log.result:
Rename: mysql-test/ndb/restart_log.result -> BitKeeper/deleted/.del-restart_log.result
mysql-test/suite/rpl/t/rpl_000015-slave.opt:
Rename: mysql-test/suite/rpl/t/rpl_000015.slave-mi -> mysql-test/suite/rpl/t/rpl_000015-slave.opt
BitKeeper/deleted/.del-ndb_config_2_node.ini:
Rename: mysql-test/ndb/ndb_config_2_node.ini -> BitKeeper/deleted/.del-ndb_config_2_node.ini
BitKeeper/deleted/.del-ndbcluster.sh:
Rename: mysql-test/ndb/ndbcluster.sh -> BitKeeper/deleted/.del-ndbcluster.sh
BitKeeper/deleted/.del-basic.result:
Rename: mysql-test/ndb/basic.result -> BitKeeper/deleted/.del-basic.result
BitKeeper/deleted/.del-restart.test:
Rename: mysql-test/ndb/restart.test -> BitKeeper/deleted/.del-restart.test
BitKeeper/deleted/.del-have_bug25714.inc:
Rename: mysql-test/include/have_bug25714.inc -> BitKeeper/deleted/.del-have_bug25714.inc
BitKeeper/deleted/.del-mtr_diff.pl:
Rename: mysql-test/lib/mtr_diff.pl -> BitKeeper/deleted/.del-mtr_diff.pl
mysql-test/suite/federated/federated_transactions-slave.opt:
Rename: mysql-test/t/federated_transactions-slave.opt -> mysql-test/suite/federated/federated_transactions-slave.opt
BitKeeper/deleted/.del-Makefile.am~343467da4d0f211b:
Rename: mysql-test/ndb/Makefile.am -> BitKeeper/deleted/.del-Makefile.am~343467da4d0f211b
BitKeeper/deleted/.del-mtr_im.pl~9762b0336c28949:
Rename: mysql-test/lib/mtr_im.pl -> BitKeeper/deleted/.del-mtr_im.pl~9762b0336c28949
mysql-test/suite/federated/federated_innodb-slave.opt:
Rename: mysql-test/t/federated_innodb-slave.opt -> mysql-test/suite/federated/federated_innodb-slave.opt
client/mysqltest.c:
Use current files path first when looking for include file
configure.in:
Remove mysql-test/nbd
mysql-test/Makefile.am:
Cleanup mysql-test/Makefile.am
mysql-test/extra/binlog_tests/blackhole.test:
Use new paths
mysql-test/extra/binlog_tests/ctype_ucs_binlog.test:
Use new paths
mysql-test/mysql-test-run.pl:
Dynamic configuration support
Safe process
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_EE_err.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_loaddata.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_log.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_row_001.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_row_charset.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_stm_000001.test:
Use new paths
mysql-test/extra/rpl_tests/rpl_stm_charset.test:
Use new paths
mysql-test/include/have_blackhole.inc:
Use new paths
mysql-test/include/have_ndbapi_examples.inc:
Use new paths
mysql-test/include/loaddata_autocom.inc:
Use new paths
mysql-test/include/mix1.inc:
Use new paths
mysql-test/include/ndb_backup.inc:
Use new paths
mysql-test/include/ndb_restore_master.inc:
Use new paths
mysql-test/include/ndb_restore_slave_eoption.inc:
Use new paths
mysql-test/include/testdb_only.inc:
Use new paths
mysql-test/lib/My/Config.pm:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_cases.pm:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_io.pl:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_misc.pl:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_process.pl:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_report.pl:
dynamic configuration
safe process
cleanups
mysql-test/lib/mtr_stress.pl:
dynamic configuration
safe process
cleanups
mysql-test/r/backup.result:
Use new paths
mysql-test/r/ctype_big5.result:
Use new paths
mysql-test/r/gis.result:
Use new paths
mysql-test/r/loaddata.result:
Use new paths
mysql-test/r/loaddata_autocom_innodb.result:
Use new paths
mysql-test/r/mysqlbinlog.result:
Use new paths
mysql-test/r/mysqlbinlog_base64.result:
Use new paths
mysql-test/r/outfile.result:
Use new paths
mysql-test/r/partition_error.result:
Use new paths
mysql-test/r/partition_not_windows.result:
Use new paths
mysql-test/r/partition_symlink.result:
Use new paths
mysql-test/r/query_cache.result:
Use new paths
mysql-test/r/sp.result:
Use new paths
mysql-test/r/symlink.result:
Use new paths
mysql-test/r/system_mysql_db.result:
Use new paths
mysql-test/r/trigger.result:
Use new paths
mysql-test/r/type_blob.result:
Use new paths
mysql-test/r/view.result:
Use new paths
mysql-test/r/warnings.result:
Use new paths
mysql-test/suite/binlog/r/binlog_killed_simulate.result:
Use new paths
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
Use new paths
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Use new paths
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
Use new paths
mysql-test/suite/binlog/t/binlog_killed.test:
Use new paths
mysql-test/suite/binlog/t/binlog_killed_simulate.test:
Use new paths
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
Use new paths
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
Use new paths
mysql-test/suite/federated/federated.inc:
Use new paths
mysql-test/suite/federated/federated.result:
Use new paths
mysql-test/suite/federated/federated.test:
Use new paths
mysql-test/suite/federated/federated_archive.result:
Use new paths
mysql-test/suite/federated/federated_archive.test:
Use new paths
mysql-test/suite/federated/federated_bug_13118.result:
Use new paths
mysql-test/suite/federated/federated_bug_13118.test:
Use new paths
mysql-test/suite/federated/federated_bug_25714.result:
Use new paths
mysql-test/suite/federated/federated_bug_25714.test:
Use new paths
mysql-test/suite/federated/federated_innodb.result:
Use new paths
mysql-test/suite/federated/federated_innodb.test:
Use new paths
mysql-test/suite/federated/federated_server.result:
Use new paths
mysql-test/suite/federated/federated_server.test:
Use new paths
mysql-test/suite/federated/federated_transactions.test:
Use new paths
mysql-test/suite/federated/have_federated_db.inc:
Use new paths
mysql-test/suite/ndb/r/loaddata_autocom_ndb.result:
Use new paths
mysql-test/suite/ndb/r/ndb_config.result:
Use new paths
mysql-test/suite/ndb/r/ndb_dd_backuprestore.result:
Use new paths
mysql-test/suite/ndb/r/ndb_load.result:
Use new paths
mysql-test/suite/ndb/r/ndb_loaddatalocal.result:
Use new paths
mysql-test/suite/ndb/r/ndb_replace.result:
Use new paths
mysql-test/suite/ndb/r/ndb_restore.result:
Use new paths
mysql-test/suite/ndb/r/ndb_restore_partition.result:
Use new paths
mysql-test/suite/ndb/r/ndb_restore_print.result:
Use new paths
mysql-test/suite/ndb/r/ndb_trigger.result:
Use new paths
mysql-test/suite/ndb/t/ndb_alter_table.test:
Use new paths
mysql-test/suite/ndb/t/ndb_config.test:
Use new paths
mysql-test/suite/ndb/t/ndb_load.test:
Use new paths
mysql-test/suite/ndb/t/ndb_loaddatalocal.test:
Use new paths
mysql-test/suite/ndb/t/ndb_replace.test:
Use new paths
mysql-test/suite/ndb/t/ndb_restore.test:
Use new paths
mysql-test/suite/ndb/t/ndb_single_user.test:
Use new paths
mysql-test/suite/ndb/t/ndb_trigger.test:
Use new paths
mysql-test/suite/ndb/t/ndbapi.test:
Use new paths
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Use new paths
mysql-test/suite/rpl/r/rpl_LD_INFILE.result:
Use new paths
mysql-test/suite/rpl/r/rpl_flushlog_loop.result:
Use new paths
mysql-test/suite/rpl/r/rpl_innodb.result:
Use new paths
mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
Use new paths
mysql-test/suite/rpl/r/rpl_load_table_from_master.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata_charset.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata_m.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata_s.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddata_simple.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
Use new paths
mysql-test/suite/rpl/r/rpl_loadfile.result:
Use new paths
mysql-test/suite/rpl/r/rpl_misc_functions.result:
Use new paths
mysql-test/suite/rpl/r/rpl_replicate_do.result:
Use new paths
mysql-test/suite/rpl/r/rpl_rewrt_db.result:
Use new paths
mysql-test/suite/rpl/r/rpl_row_001.result:
Use new paths
mysql-test/suite/rpl/r/rpl_row_loaddata_m.result:
Use new paths
mysql-test/suite/rpl/r/rpl_row_log.result:
Use new paths
mysql-test/suite/rpl/r/rpl_row_log_innodb.result:
Use new paths
mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result:
Use new paths
mysql-test/suite/rpl/r/rpl_stm_000001.result:
Use new paths
mysql-test/suite/rpl/r/rpl_stm_log.result:
Use new paths
mysql-test/suite/rpl/r/rpl_timezone.result:
Use new paths
mysql-test/suite/rpl/t/disabled.def:
Use new paths
mysql-test/suite/rpl/t/rpl000017-slave.sh:
Use new paths
mysql-test/suite/rpl/t/rpl_LD_INFILE.test:
Use new paths
mysql-test/suite/rpl/t/rpl_drop_db.test:
Use new paths
mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt:
Use new paths
mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt:
Use new paths
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
Use new paths
mysql-test/suite/rpl/t/rpl_innodb.test:
Use new paths
mysql-test/suite/rpl/t/rpl_innodb_bug30919.test:
Use new paths
mysql-test/suite/rpl/t/rpl_load_from_master.test:
Use new paths
mysql-test/suite/rpl/t/rpl_load_table_from_master.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddata_charset.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddata_fatal.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddata_m.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddata_s.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddata_simple.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loaddatalocal.test:
Use new paths
mysql-test/suite/rpl/t/rpl_loadfile.test:
Use new paths
mysql-test/suite/rpl/t/rpl_misc_functions.test:
Use new paths
mysql-test/suite/rpl/t/rpl_replicate_do.test:
Use new paths
mysql-test/suite/rpl/t/rpl_rewrt_db.test:
Use new paths
mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt:
Use new paths
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Use new paths
mysql-test/suite/rpl/t/rpl_row_charset_innodb.test:
Use new paths
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
Use new paths
mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test:
Use new paths
mysql-test/suite/rpl/t/rpl_timezone.test:
Use new paths
mysql-test/suite/rpl/t/rpl_trigger.test:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result:
Use new paths
mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Use new paths
mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test:
Use new paths
mysql-test/t/backup.test:
Use new paths
mysql-test/t/bootstrap.test:
Use new paths
mysql-test/t/crash_commit_before.test:
Use new paths
mysql-test/t/create_not_windows.test:
Use new paths
mysql-test/t/csv.test:
Use new paths
mysql-test/t/ctype_big5.test:
Use new paths
mysql-test/t/disabled.def:
Use new paths
mysql-test/t/distinct.test:
Use new paths
mysql-test/t/gis.test:
Use new paths
mysql-test/t/grant_cache_no_prot.test:
Use new paths
mysql-test/t/grant_cache_ps_prot.test:
Use new paths
mysql-test/t/information_schema_chmod.test:
Use new paths
mysql-test/t/loaddata.test:
Use new paths
mysql-test/t/log_state.test:
Use new paths
mysql-test/t/myisam-system.test:
Use new paths
mysql-test/t/mysql_upgrade.test:
Use new paths
mysql-test/t/mysqlbinlog-cp932.test:
Use new paths
mysql-test/t/mysqlbinlog.test:
Use new paths
mysql-test/t/mysqlbinlog2.test:
Use new paths
mysql-test/t/mysqlbinlog_base64.test:
Use new paths
mysql-test/t/mysqldump.test:
Use new paths
mysql-test/t/outfile.test:
Use new paths
mysql-test/t/partition.test:
Use new paths
mysql-test/t/partition_error.test:
Use new paths
mysql-test/t/partition_federated.test:
Use new paths
mysql-test/t/partition_mgm.test:
Use new paths
mysql-test/t/partition_not_windows.test:
Use new paths
mysql-test/t/partition_symlink.test:
Use new paths
mysql-test/t/query_cache.test:
Use new paths
mysql-test/t/repair.test:
Use new paths
mysql-test/t/show_check.test:
Use new paths
mysql-test/t/sp-destruct.test:
Use new paths
mysql-test/t/sp.test:
Use new paths
mysql-test/t/symlink.test:
Use new paths
mysql-test/t/system_mysql_db.test:
Use new paths
mysql-test/t/system_mysql_db_fix30020.test:
Use new paths
mysql-test/t/system_mysql_db_fix40123.test:
Use new paths
mysql-test/t/system_mysql_db_fix50030.test:
Use new paths
mysql-test/t/system_mysql_db_fix50117.test:
Use new paths
mysql-test/t/trigger-compat.test:
Use new paths
mysql-test/t/trigger-grant.test:
Use new paths
mysql-test/t/trigger.test:
Use new paths
mysql-test/t/type_blob.test:
Use new paths
mysql-test/t/type_varchar.test:
Use new paths
mysql-test/t/upgrade.test:
Use new paths
mysql-test/t/user_var-binlog.test:
Use new paths
mysql-test/t/varbinary.test:
Use new paths
mysql-test/t/view.test:
Use new paths
mysql-test/t/warnings.test:
Use new paths
mysql-test/lib/My/ConfigFactory.pm:
Initial version
mysql-test/lib/My/Find.pm:
Initial version
mysql-test/lib/My/SafeProcess.pm:
Initial version
mysql-test/std_data/ndb_config_config.ini:
Add "old" style config.ini for ndb
mysql-test/suite/federated/disabled.def:
Move disabled federated to it's new suite
mysql-test/suite/federated/my.cnf:
Add config for federated
mysql-test/suite/ndb/my.cnf:
Add config for ndb
mysql-test/suite/rpl/my.cnf:
Add config for rpl
mysql-test/suite/rpl/rpl_1slave_base.cnf:
Add base config for rpl
mysql-test/suite/rpl/t/rpl_000015-master.opt:
Use new paths
mysql-test/suite/rpl_ndb/my.cnf:
Add config for rpl_ndb
mysql-test/lib/My/File/Path.pm:
Initial version
mysql-test/lib/My/SafeProcess/Base.pm:
Initial version
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
Initial version
mysql-test/lib/My/SafeProcess/safe_process.pl:
Initial version
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Initial version
mysql-test/lib/t/Base.t:
Initial version
mysql-test/lib/t/Find.t:
Initial version
mysql-test/lib/t/SafeProcess.t:
Initial version
mysql-test/lib/t/SafeProcessStress.pl:
Initial version
mysql-test/lib/t/copytree.t:
Initial version
mysql-test/lib/t/dummyd.pl:
Initial version
mysql-test/lib/t/rmtree.t:
Initial version
mysql-test/lib/t/testMyConfig.t:
Initial version
mysql-test/lib/t/testMyConfigFactory.t:
Initial version
mysql-test/lib/t/test_child.pl:
Initial version
mysql-test/include/default_my.cnf:
Add default config file used when no suite specific file is found
mysql-test/include/default_mysqld.cnf:
New BitKeeper file ``mysql-test/include/default_mysqld.cnf''
mysql-test/include/default_ndbd.cnf:
Add default settings for all ndbds
mysql-test/lib/mtr_settings.pl:
Initial version
into dl145j.mysql.com:/tmp/andrei/bug31552
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Auto merged
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
Auto merged
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_class.h:
Auto merged
sql/log_event.cc:
manual merge
without PK
Bug#31609 Not all RBR slave errors reported as errors
bug#32468 delete rows event on a table with foreign key constraint fails
The first two bugs comprise idempotency issues.
First, there was no error code reported under conditions of the bug
description although the slave sql thread halted.
Second, executions were different with and without presence of prim key in
the table.
Third, there was no way to instruct the slave whether to ignore an error
and skip to the following event or to halt.
Fourth, there are handler errors which might happen due to idempotent
applying of binlog but those were not listed among the "idempotent" error
list.
All the named issues are addressed.
Wrt to the 3rd, there is the new global system variable, changeble at run
time, which controls the slave sql thread behaviour.
The new variable allows further extensions to mimic the sql_mode
session/global variable.
To address the 4th, the new bug#32468 had to be fixed as it was staying
in the way.
include/my_bitmap.h:
basic operations with bits of an integer type are added.
mysql-test/extra/rpl_tests/rpl_foreign_key.test:
regression test for bug#32468
mysql-test/extra/rpl_tests/rpl_row_basic.test:
changes due to bug#31552/31609 idempotency is not default any longer
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
changes due to bug#31552/31609 idempotency is not default any longer
mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result:
results changed
mysql-test/suite/rpl/r/rpl_idempotency.result:
results changed
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
results changed
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
results changed
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
results changed
mysql-test/suite/rpl/r/rpl_row_mystery22.result:
results changed
mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result:
results changed
mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result:
results changed
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
results changed
mysql-test/suite/rpl/t/rpl_idempotency.test:
extenstions to the test providing testing of complements to the
idempotent error set and checking how slave halts when it faces an error
from the list when the mode is STRICT.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
changes due to bug#31552/31609 idempotency is not default any longer.
mysql-test/suite/rpl/t/rpl_row_mystery22.test:
changes due to bug#31552/31609 idempotency is not default any longer
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
changes due to bug#31552/31609 idempotency is not default any longer
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result:
results changed
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
results changed
sql/log_event.cc:
the fix for bug#32468 delete rows event on a table with foreign key constraint fails
ensures the flags are set at proper time so that their values will be caught
by innodb.
reseting the flags is done along the common error and errorless execution
path.
The list of idempotent error is extended with foreign keys related items.
NDB engine write events are designed with the replace sematics in mind.
Therefore the corrsponding ndb handler's flag are (re)set regardless of
the slave's execution mode.
Rows_log_event::write_row() starts using the bool replace argument as its
caller sets it depending on the event's execution mode.
sql/log_event.h:
adding a new member to hold the slave's mode during execution of the event.
sql/mysql_priv.h:
changes to link the command line option with the new global sys var.
sql/mysqld.cc:
introduction of the new command line option.
providing its initialization to a default.
changes to link the command line option with the new global sys var.
sql/rpl_rli.cc:
rli post-event-execution cleanup restores the default bits.
sql/set_var.cc:
The new "standard" sys_var_set class' and the new global system var related
declarations and definitions.
fix_slave_exec_mode() is used as with the update method of a new class so
as at time of the command line arguments parsing.
sql/set_var.h:
new declarations. The class for the new global sys var is based on
yet another new "standard" one.
sql/share/errmsg.txt:
slave_exec_mode setting error;
slave inconsistency error which may be not an error when the intention
is "idempotent". I.e consisting of row-based events binlog is being
applied for the 2nd (more) time.
sql/sql_class.h:
The names for the bits of the new sever slave_exec_mode_options.
mysql-test/suite/rpl/t/rpl_idempotency-master.opt:
innodb is necessary
mysql-test/suite/rpl/t/rpl_idempotency-slave.opt:
innodb is necessary, as well as the tests start with non-default
IDEMPOTENT slave execution mode.
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result:
Auto merged
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
manual merge
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
manual merge
into mysql.com:/home/ram/work/b32726/b32726.5.1
mysql-test/r/ctype_euckr.result:
Auto merged
mysql-test/r/ctype_uca.result:
Auto merged
strings/ctype-cp932.c:
Auto merged
mysql-test/extra/binlog_tests/ctype_cp932.test:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result:
Auto merged
into stella.local:/home2/mydev/mysql-5.1-axmrg
include/my_base.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/suite/ndb/t/disabled.def:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
client/mysql.cc:
Manual merge
mysql-test/suite/rpl/t/disabled.def:
Manual merge
DROP DATABASE statement writes changes to mysql.proc table under RBR
When replicating a DROP DATABASE statement with a database holding
stored procedures, the changes to the mysql.proc table was recorded
in the binary log under row-based replication.
With this patch, the thread uses statement-logging format for the
duration of the DROP DATABASE statement. The logging format is
(already) reset at the end of the statement, so no additional code
for resetting the logging format is necessary.
sql/sql_db.cc:
Clearing the row-based statement flag for the DROP DATABASE statement
since it should always be replicated as a statement.
mysql-test/extra/binlog_tests/database.test:
New BitKeeper file ``mysql-test/extra/binlog_tests/database.test''
mysql-test/suite/binlog/r/binlog_database.result:
New BitKeeper file ``mysql-test/suite/binlog/r/binlog_database.result''
mysql-test/suite/binlog/t/binlog_database.test:
New BitKeeper file ``mysql-test/suite/binlog/t/binlog_database.test''
corrupts a MERGE table
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
memory/cpu hogging
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Bug 25038 - Waiting TRUNCATE
Bug 25700 - merge base tables get corrupted by
optimize/analyze/repair table
Bug 30275 - Merge tables: flush tables or unlock tables
causes server to crash
Bug 19627 - temporary merge table locking
Bug 27660 - Falcon: merge table possible
Bug 30273 - merge tables: Can't lock file (errno: 155)
The problems were:
Bug 26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
1. A thread trying to lock a MERGE table performs busy waiting while
REPAIR TABLE or a similar table administration task is ongoing on
one or more of its MyISAM tables.
2. A thread trying to lock a MERGE table performs busy waiting until all
threads that did REPAIR TABLE or similar table administration tasks
on one or more of its MyISAM tables in LOCK TABLES segments do UNLOCK
TABLES. The difference against problem #1 is that the busy waiting
takes place *after* the administration task. It is terminated by
UNLOCK TABLES only.
3. Two FLUSH TABLES within a LOCK TABLES segment can invalidate the
lock. This does *not* require a MERGE table. The first FLUSH TABLES
can be replaced by any statement that requires other threads to
reopen the table. In 5.0 and 5.1 a single FLUSH TABLES can provoke
the problem.
Bug 26867 - LOCK TABLES + REPAIR + merge table result in
memory/cpu hogging
Trying DML on a MERGE table, which has a child locked and
repaired by another thread, made an infinite loop in the server.
Bug 26377 - Deadlock with MERGE and FLUSH TABLE
Locking a MERGE table and its children in parent-child order
and flushing the child deadlocked the server.
Bug 25038 - Waiting TRUNCATE
Truncating a MERGE child, while the MERGE table was in use,
let the truncate fail instead of waiting for the table to
become free.
Bug 25700 - merge base tables get corrupted by
optimize/analyze/repair table
Repairing a child of an open MERGE table corrupted the child.
It was necessary to FLUSH the child first.
Bug 30275 - Merge tables: flush tables or unlock tables
causes server to crash
Flushing and optimizing locked MERGE children crashed the server.
Bug 19627 - temporary merge table locking
Use of a temporary MERGE table with non-temporary children
could corrupt the children.
Temporary tables are never locked. So we do now prohibit
non-temporary chidlren of a temporary MERGE table.
Bug 27660 - Falcon: merge table possible
It was possible to create a MERGE table with non-MyISAM children.
Bug 30273 - merge tables: Can't lock file (errno: 155)
This was a Windows-only bug. Table administration statements
sometimes failed with "Can't lock file (errno: 155)".
These bugs are fixed by a new implementation of MERGE table open.
When opening a MERGE table in open_tables() we do now add the
child tables to the list of tables to be opened by open_tables()
(the "query_list"). The children are not opened in the handler at
this stage.
After opening the parent, open_tables() opens each child from the
now extended query_list. When the last child is opened, we remove
the children from the query_list again and attach the children to
the parent. This behaves similar to the old open. However it does
not open the MyISAM tables directly, but grabs them from the already
open children.
When closing a MERGE table in close_thread_table() we detach the
children only. Closing of the children is done implicitly because
they are in thd->open_tables.
For more detail see the comment at the top of ha_myisammrg.cc.
Changed from open_ltable() to open_and_lock_tables() in all places
that can be relevant for MERGE tables. The latter can handle tables
added to the list on the fly. When open_ltable() was used in a loop
over a list of tables, the list must be temporarily terminated
after every table for open_and_lock_tables().
table_list->required_type is set to FRMTYPE_TABLE to avoid open of
special tables. Handling of derived tables is suppressed.
These details are handled by the new function
open_n_lock_single_table(), which has nearly the same signature as
open_ltable() and can replace it in most cases.
In reopen_tables() some of the tables open by a thread can be
closed and reopened. When a MERGE child is affected, the parent
must be closed and reopened too. Closing of the parent is forced
before the first child is closed. Reopen happens in the order of
thd->open_tables. MERGE parents do not attach their children
automatically at open. This is done after all tables are reopened.
So all children are open when attaching them.
Special lock handling like mysql_lock_abort() or mysql_lock_remove()
needs to be suppressed for MERGE children or forwarded to the parent.
This depends on the situation. In loops over all open tables one
suppresses child lock handling. When a single table is touched,
forwarding is done.
Behavioral changes:
===================
This patch changes the behavior of temporary MERGE tables.
Temporary MERGE must have temporary children.
The old behavior was wrong. A temporary table is not locked. Hence
even non-temporary children were not locked. See
Bug 19627 - temporary merge table locking.
You cannot change the union list of a non-temporary MERGE table
when LOCK TABLES is in effect. The following does *not* work:
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ...;
LOCK TABLES t1 WRITE, t2 WRITE, m1 WRITE;
ALTER TABLE m1 ... UNION=(t1,t2) ...;
However, you can do this with a temporary MERGE table.
You cannot create a MERGE table with CREATE ... SELECT, neither
as a temporary MERGE table, nor as a non-temporary MERGE table.
CREATE TABLE m1 ... ENGINE=MRG_MYISAM ... SELECT ...;
Gives error message: table is not BASE TABLE.
include/my_base.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN.
include/myisammrg.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added element 'children_attached' to MYRG_INFO.
Added declarations for myrg_parent_open(),
myrg_attach_children() and myrg_detach_children()
for the new MERGE table open approach.
mysql-test/extra/binlog_tests/blackhole.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Preliminarily added new error message with a comment.
mysql-test/r/create.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed test result.
mysql-test/r/delayed.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Moved test result from here to merge.result.
mysql-test/r/merge.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed/added test result.
mysql-test/r/myisam.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Moved test result for bug 8306 from here to merge.result.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed test result.
mysql-test/t/create.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed error number.
mysql-test/t/delayed.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Moved test from here to merge.test.
mysql-test/t/merge.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed test for new temporary MERGE table behavior.
Exchanged error numbers by symbolic codes.
Added tests. Included are tests for bugs
8306 (moved from myisam.test), 26379, 19627, 25038, 25700, 26377,
26867, 27660, 30275, and 30273.
Fixed changes resulting from disabled CREATE...SELECT.
Integrated tests moved from delayed.test and myisam.test to here.
mysql-test/t/myisam.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Moved test for bug 8306 from here to merge.test.
mysys/thr_lock.c:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added code to let the owner of a high priority lock (TL_WRITE_ONLY)
to bypass its own lock.
sql/ha_ndbcluster_binlog.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added 'thd' argument to init_tmp_table_share().
sql/handler.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added 'thd' argument to init_tmp_table_share().
sql/mysql_priv.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Removed declaration of check_merge_table_access(). It is now static
in sql_parse.cc.
Added declaration for fix_merge_after_open().
Renamed open_and_lock_tables() to open_and_lock_tables_derived()
with additional parameter 'derived'.
Added inline functions simple_open_n_lock_tables() and
open_and_lock_tables(), which call open_and_lock_tables_derived()
and add the argument for 'derived'.
Added new function open_n_lock_single_table(), which can be used
as an replacement for open_ltable() in most situations. Internally
it calls simple_open_n_lock_tables() so hat it is appropriate for
MERGE tables.
Added 'thd' argument to init_tmp_table_share().
sql/slave.cc:
ug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added comment.
sql/sql_base.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Defined new functions add_merge_table_list(),
attach_merge_children(), detach_merge_children(), and
fix_merge_after_open() for the new MERGE table open approach.
Added calls of the new functions to
close_handle_and_leave_table_as_lock(), close_thread_tables(),
close_thread_table(), unlink_open_table(), reopen_name_locked_table(),
reopen_table(), drop_locked_tables(), close_temporary_table(),
and open_tables() respectively.
Prevented special lock handling of merge children (like
mysql_lock_remove, mysql_lock_merge or mysql_lock_abort)
at many places. Some of these calls are forwarded to the
parent table instead.
Added code to set thd->some_tables_deleted for every thread that has
a table open that we are flushing.
Added code for MERGE tables to unlink_open_table().
Added MERGE children to the list of unusable tables in open_table().
Added MERGE table handling to reopen_table().
Added lock handling and closing of a parent before the children
in close_data_files_and_morph_locks().
Added code for re-attaching children in reopen_tables().
Added MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN to the locking flags and
error reporting after mysql_lock_tables() in reopen_tables().
Added lock handling and closing of a parent before the children
in close_old_data_files().
Added lock handling and detaching in drop_locked_tables().
Added code for removing the children list from the statement list
to prepare for a repetition in open_tables().
Added new function open_n_lock_single_table(), which can be used
as an replacement for open_ltable() in most situations. Internally
it calls simple_open_n_lock_tables() so hat it is appropriate for
MERGE tables.
Disabled use of open_ltable() for MERGE tables.
Removed function simple_open_n_lock_tables(). It is now inline
declared in mysql_priv.h.
Renamed open_and_lock_tables() to open_and_lock_tables_derived()
with additional parameter 'derived'. open_and_lock_tables() is now
inline declared in mysql_priv.h.
Added a check for end-of-list in two loops in lock_tables().
Added 'thd' argument to init_tmp_table_share().
sql/sql_insert.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Changed from open_ltable() to open_n_lock_single_table() in
handle_delayed_insert().
Reestablished LEX settings after lex initialization.
Added 'thd' argument to init_tmp_table_share().
sql/sql_parse.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Made check_merge_table_access() a static function.
Disabled use of CREATE...SELECT for MERGE tables.
sql/sql_partition.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Fixed comment typo.
sql/sql_select.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added 'thd' argument to init_tmp_table_share().
sql/sql_table.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Optimized use of mysql_ha_flush() in mysql_rm_table_part2().
Disabled the use of MERGE tables with prepare_for_restore() and
prepare_for_repair().
Changed from open_ltable() to open_n_lock_single_table() in
mysql_alter_table() and mysql_checksum_table().
Disabled change of child list under LOCK TABLES.
Initialized table_list->table in mysql_recreate_table().
sql/sql_trigger.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added code for allowing CREATE TRIGGER under LOCK TABLE, to be able
to test it with MERGE tables.
sql/table.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added 'thd' argument to init_tmp_table_share().
Setting table_map_id from query_id in init_tmp_table_share().
Added member function TABLE::is_children_attached().
sql/table.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added access method get_table_def_version() to TABLE_SHARE.
Added elements for MERGE tables to TABLE and TABLE_LIST.
storage/myisam/ha_myisam.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added an unrelated comment to the function comment of table2myisam().
storage/myisam/ha_myisam.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added new member function MI_INFO::file_ptr().
storage/myisammrg/ha_myisammrg.cc:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added callback functions to support parent open and children attach
of MERGE tables.
Changed ha_myisammrg::open() to initialize storage engine structures
and create a list of child tables only. Child tables are not opened.
Added ha_myisammrg::attach_children(), which does now the main part
of MERGE open.
Added ha_myisammrg::detach_children().
Added calls to ::attach_children() and ::detach_children() to
::extra() on HA_EXTRA_ATTACH_CHILDREN and HA_EXTRA_DETACH_CHILDREN
respectively.
Added a check for matching TEMPORARY type for children against
parent.
Added a check for table def version.
Added support for thd->open_options to attach_children().
Changed child path name generation for temporary tables so that
it does nothing special for temporary tables.
storage/myisammrg/ha_myisammrg.h:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added elements to class ha_myisammrg to support the new
open approach.
Changed empty destructor definition to a declaration.
Implemented in ha_myisammrg.cc.
Added declaration for methods attach_children() and
detach_children().
Added definition for method table_ptr() for use with
callback functions.
storage/myisammrg/myrg_close.c:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Added a check to avoid closing of MyISAM tables when the
child tables are not attached.
Added freeing of rec_per_key_part when the child tables
are not attached.
storage/myisammrg/myrg_extra.c:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Some ::extra() functions and ::reset() can be called when
children are detached.
storage/myisammrg/myrg_open.c:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table
Kept old myrg_open() for MERGE use independent from MySQL.
Removed an always true condition in myrg_open().
Set children_attached for independent MERGE use in myrg_open().
Added myrg_parent_open(), myrg_attach_children(), and
myrg_detach_children() for the new MERGE table open approach.
mysql-test/r/merge-big.result:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
New test result
mysql-test/t/merge-big.test:
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table
New test case
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-new-rpl
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Auto merged
mysql-test/suite/rpl/r/rpl_bug31076.result:
Auto merged
mysql-test/suite/rpl/t/rpl_bug31076.test:
Auto merged
mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
Auto merged
sql/field.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event_old.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/t/partition.test:
Manual merge.
BitKeeper/deleted/.del-rpl_row_extraColmaster_ndb.result~a2c64bae75b49d2:
Manual merge.
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Manual merge.
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Manual merge.
mysql-test/suite/rpl/t/disabled.def:
Manual merge.
sql/sql_delete.cc:
Manual merge.
Pushing test case for bug only. Bug already fixed as a result of the patch for BUG#19958.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Adding test to see that no error is given on slave when deleting
rows that don't exist on table without primary key.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
Result change.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
Result change.
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result:
Result change.