Bel*_*ell 6 mysql innodb mysql-5.5
当使用具有 READ COMMITTED 隔离级别的 MIXED 格式时,我安全吗?
文档状态(http://dev.mysql.com/doc/refman/5.5/en/set-transaction.html#isolevel_read-committed)
如果使用 READ COMMITTED 或启用 innodb_locks_unsafe_for_binlog,则必须使用基于行的二进制日志记录
在名单中 When running in MIXED logging format, the server automatically switches from statement-based to row-based logging under the following conditions
..隔离级别没有提到:http : //dev.mysql.com/doc/refman/5.5/en/binary-log-mixed.html
此外,以下来自 2006/2007 的错误讨论了如果隔离级别与不兼容的日志格式一起使用,则添加警告或错误消息。请参阅评论部分中的错误链接
我已经在 MySQL 5.5 中测试了该组合,但没有收到任何警告。所以我假设如果使用隔离,则使用行格式。我对吗?
更新
以下表明它是安全的(当有 MIXED 时将使用 ROW)。在评论中链接到手册(我不能发布超过 2 个链接)
如果您使用 InnoDB 表并且事务隔离级别为 READ COMMITTED 或 READ UNCOMMITTED,则只能使用基于行的日志记录。这是可能的更改日志格式声明,但在运行时引线这样做非常迅速错误因为InnoDB不能再执行插入。
给定的存储引擎可以支持其中一种或两种日志记录格式。下表列出了每个引擎支持的格式。
在该页该句子下提到的表格中
+--------------+---------------------+----------------------------------+
|Storage Engine|Row Logging Supported|Statement Logging Supported |
+--------------+---------------------+----------------------------------+
|ARCHIVE |Yes |Yes |
+--------------+---------------------+----------------------------------+
|BLACKHOLE |Yes |Yes |
+--------------+---------------------+----------------------------------+
|CSV |Yes |Yes |
+--------------+---------------------+----------------------------------+
|EXAMPLE |Yes |No |
+--------------+---------------------+----------------------------------+
|FEDERATED |Yes |Yes |
+--------------+---------------------+----------------------------------+
|HEAP |Yes |Yes |
+--------------+---------------------+----------------------------------+
|InnoDB |Yes |Yes when the transaction |
| | |isolation level is REPEATABLE | <== NOTE THIS
| | |READ or SERIALIZABLE; No otherwise|
+--------------+---------------------+----------------------------------+
|MyISAM |Yes |Yes |
+--------------+---------------------+----------------------------------+
|MERGE |Yes |Yes |
+--------------+---------------------+----------------------------------+
|NDB |Yes |No |
+--------------+---------------------+----------------------------------+
Run Code Online (Sandbox Code Playgroud)
因此,.binlog_format=MIXED不支持READ COMMITTED。
| 归档时间: |
|
| 查看次数: |
1472 次 |
| 最近记录: |