MySQL 事務表和非事務表

來源:互聯網
上載者:User

標籤:

MySQL 事務表和非事務表

查看 max_binlog_stmt_cache_size 參數解釋時(入門教程qkxue.net),有這麼一句話 If nontransactional statements within a transaction require more than this many bytes of memory, the server generates an error.


那麼,什麼是 nontransactional statements ?


在 http://dev.mysql.com/ 尋找 nontransactional關鍵字,出來的第一個是 Rollback Failure for Nontransactional Tables 。


那麼什麼又是 Nontransactional Tables ?


Nontransactional Tables(騰雲科技ty300.com),非事務表,不支援事務的表,也就是使用MyISAM儲存引擎的表。


非事務表的特點是不支援復原,看下面的列子
  

 >create table no_trans(id int) ENGINE=MyiSAM;    >start transaction;    >insert into no_trans values(1);    >select * from no_trans;    +------+    | id   |    +------+    |    1 |    +------+    1 row in set (0.00 sec)         >rollback;    Query OK, 0 rows affected, 1 warning (0.00 sec)         >show warnings;    +---------+------+---------------------------------------------------------------+    | Level   | Code | Message                                                       |    +---------+------+---------------------------------------------------------------+    | Warning | 1196 | Some non-transactional changed tables couldn‘t be rolled back |    +---------+------+---------------------------------------------------------------+    1 row in set (0.00 sec)         >select * from no_trans;    +------+    | id   |    +------+    |    1 |    +------+    1 row in set (0.00 sec)

 可以看到,非事務表復原拋出警告,顯示非事務表不支援復原。

與非事務表對象的是事務表,比如使用InnoDB的表,支援復原操作。

稿源:勤快學QKXue.NET

閱讀圖文完整版MySQL 事務表和非事務表

MySQL 事務表和非事務表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.