summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-02-02 10:56:42 +0300
committerAlexander Nozdrin <alik@sun.com>2010-02-02 10:56:42 +0300
commit33e5e125f512bcac0a0401fe7752dde4e05e4518 (patch)
treeb99ef4489c7327bb2c9e65e9e8467e6464aadea6 /mysql-test/extra
parent562c6046d4273e946872910baa411cf551a292af (diff)
downloadmariadb-git-33e5e125f512bcac0a0401fe7752dde4e05e4518.tar.gz
Manual merge of patch for Bug#46364 from mysql-next-mr-bugfixing.
Conflicts: - mysql-test/r/mysqld--help-win.result - sql/sys_vars.cc Original revsion (in next-mr-bugfixing): ------------------------------------------------------------ revno: 2971 [merge] revision-id: alfranio.correia@sun.com-20100121210527-rbuheu5rnsmcakh1 committer: Alfranio Correia <alfranio.correia@sun.com> branch nick: mysql-next-mr-bugfixing timestamp: Thu 2010-01-21 21:05:27 +0000 message: BUG#46364 MyISAM transbuffer problems (NTM problem) It is well-known that due to concurrency issues, a slave can become inconsistent when a transaction contains updates to both transaction and non-transactional tables. In a nutshell, the current code-base tries to preserve causality among the statements by writing non-transactional statements to the txn-cache which is flushed upon commit. However, modifications done to non-transactional tables on behalf of a transaction become immediately visible to other connections but may not immediately get into the binary log and therefore consistency may be broken. In general, it is impossible to automatically detect causality/dependency among statements by just analyzing the statements sent to the server. This happen because dependency may be hidden in the application code and it is necessary to know a priori all the statements processed in the context of a transaction such as in a procedure. Moreover, even for the few cases that we could automatically address in the server, the computation effort required could make the approach infeasible. So, in this patch we introduce the option - "--binlog-direct-non-transactional-updates" that can be used to bypass the current behavior in order to write directly to binary log statements that change non-transactional tables. Besides, it is used to enable the WL#2687 which is disabled by default. ------------------------------------------------------------ revno: 2970.1.1 revision-id: alfranio.correia@sun.com-20100121131034-183r4qdyld7an5a0 parent: alik@sun.com-20100121083914-r9rz2myto3tkdya0 committer: Alfranio Correia <alfranio.correia@sun.com> branch nick: mysql-next-mr-bugfixing timestamp: Thu 2010-01-21 13:10:34 +0000 message: BUG#46364 MyISAM transbuffer problems (NTM problem) It is well-known that due to concurrency issues, a slave can become inconsistent when a transaction contains updates to both transaction and non-transactional tables. In a nutshell, the current code-base tries to preserve causality among the statements by writing non-transactional statements to the txn-cache which is flushed upon commit. However, modifications done to non-transactional tables on behalf of a transaction become immediately visible to other connections but may not immediately get into the binary log and therefore consistency may be broken. In general, it is impossible to automatically detect causality/dependency among statements by just analyzing the statements sent to the server. This happen because dependency may be hidden in the application code and it is necessary to know a priori all the statements processed in the context of a transaction such as in a procedure. Moreover, even for the few cases that we could automatically address in the server, the computation effort required could make the approach infeasible. So, in this patch we introduce the option - "--binlog-direct-non-transactional-updates" that can be used to bypass the current behavior in order to write directly to binary log statements that change non-transactional tables. Besides, it is used to enable the WL#2687 which is disabled by default.
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test41
-rw-r--r--mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test38
-rw-r--r--mysql-test/extra/rpl_tests/rpl_mixing_engines.test5
3 files changed, 33 insertions, 51 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
index 55dc7ca6514..3d8a8b9fb12 100644
--- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
+++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test
@@ -344,30 +344,14 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (1, $data);
--eval INSERT INTO t1 (a, data) VALUES (2, $data);
--eval INSERT INTO t2 (a, data) VALUES (3, $data);
-if (`SELECT @@binlog_format = 'STATEMENT'`)
-{
- --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
- --eval INSERT INTO t1 (a, data) VALUES (4, $data);
-}
-if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
-{
- --eval INSERT INTO t1 (a, data) VALUES (4, $data);
-}
+--eval INSERT INTO t1 (a, data) VALUES (4, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (5, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (6, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (7, $data);
-if (`SELECT @@binlog_format = 'STATEMENT'`)
-{
- --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
- --eval UPDATE t2 SET data= CONCAT($data, $data);
-}
-if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
-{
- --eval UPDATE t2 SET data= CONCAT($data, $data);
-}
+--eval UPDATE t2 SET data= CONCAT($data, $data);
--eval INSERT INTO t1 (a, data) VALUES (8, 's');
--eval INSERT INTO t1 (a, data) VALUES (9, 's');
--eval INSERT INTO t2 (a, data) VALUES (10, 's');
@@ -380,31 +364,12 @@ BEGIN;
--eval INSERT INTO t1 (a, data) VALUES (15, $data);
--eval INSERT INTO t1 (a, data) VALUES (16, $data);
--eval INSERT INTO t2 (a, data) VALUES (17, $data);
-if (`SELECT @@binlog_format = 'STATEMENT'`)
-{
- --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
- --eval INSERT INTO t1 (a, data) VALUES (18, $data);
-}
-if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`)
-{
- --eval INSERT INTO t1 (a, data) VALUES (18, $data);
-}
+--eval INSERT INTO t1 (a, data) VALUES (18, $data);
--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE
--eval INSERT INTO t1 (a, data) VALUES (19, $data);
--enable_query_log
COMMIT;
-if (`SELECT @@binlog_format = 'STATEMENT'`)
-{
- connection slave;
- --source include/wait_for_slave_sql_to_stop.inc
-
- SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
- START SLAVE SQL_THREAD;
- --source include/wait_for_slave_sql_to_start.inc
- connection master;
-}
-
let $diff_statement= SELECT * FROM t1;
--source include/diff_master_slave.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
index 39d18b7403d..056b449b8fb 100644
--- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
+++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test
@@ -219,13 +219,12 @@ while (`SELECT $ddl_cases >= 1`)
# in the binary log:
#
# 1: DDL EVENT which triggered the previous commmit.
- # 2: COMMIT
- # 3: BEGIN
- # 4: TABLE MAP EVENT
- # 5: TABLE MAP EVENT (ndb_apply_status)
+ # 2: BEGIN
+ # 3: TABLE MAP EVENT
+ # 4: TABLE MAP EVENT (ndb_apply_status)
+ # 5: ROW EVENT
# 6: ROW EVENT
- # 7: ROW EVENT
- # 8: COMMIT
+ # 7: COMMIT
#
if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`)
{
@@ -362,8 +361,11 @@ while (`SELECT $ddl_cases >= 1`)
# does not commit the current transaction.
#
# 1: BEGIN
- # 2: INSERT
- # 3: CREATE TEMPORARY
+ # 2: CREATE TEMPORARY
+ # 3: COMMIT
+ # 4: BEGIN
+ # 5: INSERT
+ # 6: COMMIT
#
# In RBR the transaction is not committed either and the statement is not
# written to the binary log:
@@ -371,10 +373,11 @@ while (`SELECT $ddl_cases >= 1`)
# 1: BEGIN
# 2: TABLE MAP EVENT
# 3: ROW EVENT
+ # 4: COMMIT
#
- if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
+ if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` )
{
- let $commit_event_row_number= 4;
+ let $commit_event_row_number= 6;
}
#
# In NDB (RBR mode), the commit event is the sixth event
@@ -482,9 +485,14 @@ while (`SELECT $ddl_cases >= 1`)
# In SBR and MIXED modes, the DDL statement is written to the binary log
# but does not commit the current transaction:
#
+ # In SBR, we have what follows:
+ #
# 1: BEGIN
- # 2: INSERT
- # 3: DROP TEMPORARY
+ # 2: DROP TEMPORARY
+ # 3: COMMIT
+ # 4: BEGIN
+ # 5: INSERT
+ # 6: COMMIT
#
# In RBR the transaction is not committed either and the statement is not
# written to the binary log:
@@ -492,9 +500,14 @@ while (`SELECT $ddl_cases >= 1`)
# 1: BEGIN
# 2: TABLE MAP EVENT
# 3: ROW EVENT
+ # 4: COMMIT
#
if (`select @@binlog_format = 'STATEMENT'`)
{
+ let $commit_event_row_number= 6;
+ }
+ if (`select @@binlog_format = 'ROW'`)
+ {
let $commit_event_row_number= 4;
}
# In MIXED mode, the changes are logged as rows and we have what follows:
@@ -503,6 +516,7 @@ while (`SELECT $ddl_cases >= 1`)
# 2: TABLE MAP EVENT
# 3: ROW EVENT
# 4: DROP TEMPORARY table IF EXISTS
+ # 5: COMMIT
#
if (`select @@binlog_format = 'MIXED'`)
{
diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
index b8b2b1bc01b..5df1eaf37cc 100644
--- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
+++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test
@@ -1767,7 +1767,10 @@ sync_slave_with_master;
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
---diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
+if (`select @@session.binlog_format != 'STATEMENT'`)
+{
+ --diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql
+}
--echo ###################################################################################
--echo # CLEAN