diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-02-05 01:08:08 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-02-05 01:08:08 +0300 |
commit | ad0f1f8021dff9b93bd963603a790b5c30a7c01a (patch) | |
tree | a1d34e4650281143b62067088c8965f2cceacb2d /storage | |
parent | 06e1a73af6ca0b912153b10bb23deba8fd333974 (diff) | |
parent | b78e3a5d1efff8958a2ac44efadbefacaba0f163 (diff) | |
download | mariadb-git-ad0f1f8021dff9b93bd963603a790b5c30a7c01a.tar.gz |
Merge next-mr -> next-4284.
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 | 12 |
3 files changed, 21 insertions, 7 deletions
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 8d2eb914a97..fb143f0b8d4 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -383,7 +383,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 4f88d6ced8e..48f0bbbf9cd 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 0c2ab3799c2..77c223a67ab 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -7926,6 +7926,7 @@ ha_innobase::external_lock( ulong const tx_isolation = thd_tx_isolation(ha_thd()); if (tx_isolation <= ISO_READ_COMMITTED && binlog_format == BINLOG_FORMAT_STMT + && !(table_flags() & HA_BINLOG_STMT_CAPABLE) #if MYSQL_VERSION_ID > 50140 && thd_binlog_filter_ok(thd) #endif /* MYSQL_VERSION_ID > 50140 */ @@ -7937,8 +7938,15 @@ ha_innobase::external_lock( " 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); - DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); + /* The error may be suppressed by test cases, by setting + the no_innodb_binlog_errors debug symbol. */ + if (DBUG_EVALUATE_IF("no_innodb_binlog_errors", 0, 1)) { + 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); + } } } |