summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2010-02-22 03:25:33 +0000
committerAlfranio Correia <alfranio.correia@sun.com>2010-02-22 03:25:33 +0000
commit3fad4e8df1281c43d4fd343d3107b0a8e52c2327 (patch)
treec5dd369b1ce37b5593c4e71c573287b9c6916e3d /sql/sql_lex.h
parenteb79ef1535f092a2e3fee9cf514ff0c581de0bd2 (diff)
downloadmariadb-git-3fad4e8df1281c43d4fd343d3107b0a8e52c2327.tar.gz
BUG#49019 Mixing self-logging eng. and regular eng. does not switch to row in mixed mode
Reading from a self-logging engine and updating a transactional engine such as Innodb generates changes that are written to the binary log in the statement format and may make slaves diverge. In the mixed mode, such changes should be written to the binary log in the row format. Note that the issue does not happen if we mix a self-logging engine and MyIsam as this case is caught by checking the mixture of non-transactional and transactional engines. So, we classify a mixed statement where one reads from NDB and writes into another engine as unsafe: if (multi_engine && flags_some_set & HA_HAS_OWN_BINLOGGING) lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE); mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_engines_transactions.result: Augmented test case to check mixed statements mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test: Augmented test case to check mixed statements sql/share/errmsg-utf8.txt: Added ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE sql/sql_class.cc: Redefined flags' name in order to have two sets of flags: (i) flags that are checked when there is a write operation; (ii) flags that are checked regardless of the type of the operation. Classified a mixed statement where one reads from NDB and writes into another engine as unsafe: if (multi_engine && flags_some_set & HA_HAS_OWN_BINLOGGING) lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE); sql/sql_lex.cc: Added error ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE sql/sql_lex.h: Added BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 7ec87806ea5..45a86464b5a 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1141,6 +1141,12 @@ public:
*/
BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS,
+ /**
+ Mixing self-logging and non-self-logging engines in a statement
+ is unsafe.
+ */
+ BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE,
+
/* The last element of this enumeration type. */
BINLOG_STMT_UNSAFE_COUNT
};