diff options
author | Sven Sandberg <sven.sandberg@sun.com> | 2009-07-14 22:12:27 +0200 |
---|---|---|
committer | Sven Sandberg <sven.sandberg@sun.com> | 2009-07-14 22:12:27 +0200 |
commit | 45f724ec545837392f877eda27a803d473e8b59f (patch) | |
tree | 976db5058c7fdd791ea0d6dab9826f710269dbd0 /storage | |
parent | 5b178e9a2af23226828f9c71fa6b1b82db319a9e (diff) | |
parent | f3985c649d65c2d932a6f74d22de3d2e6624d525 (diff) | |
download | mariadb-git-45f724ec545837392f877eda27a803d473e8b59f.tar.gz |
Merged fix for BUG#39934 up a few revisions.
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()).
Diffstat (limited to 'storage')
-rw-r--r-- | storage/example/ha_example.cc | 8 | ||||
-rw-r--r-- | storage/example/ha_example.h | 8 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 30 |
3 files changed, 26 insertions, 20 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 604722c3c8c..2c7512afda5 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -355,7 +355,13 @@ int ha_example::close(void) int ha_example::write_row(uchar *buf) { DBUG_ENTER("ha_example::write_row"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + /* + Example of a successful write_row. We don't store the data + anywhere; they are thrown away. A real implementation will + probably need to do something with 'buf'. We report a success + here, to pretend that the insert was successful. + */ + DBUG_RETURN(0); } diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index ec3987ced5d..e565bd5ffba 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -83,11 +83,11 @@ public: ulonglong table_flags() const { /* - We are saying that this engine is just row capable to have an - engine that can only handle row-based logging. This is used in - testing. + We are saying that this engine is just statement capable to have + an engine that can only handle statement-based logging. This is + used in testing. */ - return HA_BINLOG_ROW_CAPABLE; + return HA_BINLOG_STMT_CAPABLE; } /** @brief diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2f29ca62000..39e311fbd4b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6854,21 +6854,21 @@ ha_innobase::external_lock( /* Statement based binlogging does not work in isolation level READ UNCOMMITTED and READ COMMITTED since the necessary locks cannot be taken. In this case, we print an - informative error message and return with an error. */ - if (lock_type == F_WRLCK) - { - ulong const binlog_format= thd_binlog_format(thd); - ulong const tx_isolation = thd_tx_isolation(current_thd); - if (tx_isolation <= ISO_READ_COMMITTED && - binlog_format == BINLOG_FORMAT_STMT) - { - char buf[256]; - my_snprintf(buf, sizeof(buf), - "Transaction level '%s' in" - " InnoDB is not safe for binlog mode '%s'", - tx_isolation_names[tx_isolation], - binlog_format_names[binlog_format]); - my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf); + informative error message and return with an error. + Note: decide_logging_format would give the same error message, + except it cannot give the extra details. + */ + if (lock_type == F_WRLCK && + !(table_flags() & HA_BINLOG_STMT_CAPABLE) && + thd_binlog_format(thd) == BINLOG_FORMAT_STMT) { + int skip = 0; + /* used by test case */ + DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = 1;); + if (!skip) { + my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0), + " InnoDB is limited to row-logging when " + "transaction isolation level is " + "READ COMMITTED or READ UNCOMMITTED."); DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); } } |