{"id":862,"date":"2017-08-16T08:54:00","date_gmt":"2017-08-16T00:54:00","guid":{"rendered":"http:\/\/www.5x44.cn\/?p=862"},"modified":"2017-09-09T11:28:40","modified_gmt":"2017-09-09T03:28:40","slug":"innodb%e5%9c%a8%e4%b8%8d%e5%90%8c%e9%9a%94%e7%a6%bb%e7%ba%a7%e5%88%ab%e4%b8%8b%e7%9a%84%e4%b8%80%e8%87%b4%e6%80%a7%e8%af%bb%e7%ba%a7%e9%94%81%e7%9a%84%e5%b7%ae%e5%bc%82","status":"publish","type":"post","link":"https:\/\/www.5x44.cn\/?p=862","title":{"rendered":"InnoDB\u5728\u4e0d\u540c\u9694\u79bb\u7ea7\u522b\u4e0b\u7684\u4e00\u81f4\u6027\u8bfb\u7ea7\u9501\u7684\u5dee\u5f02"},"content":{"rendered":"<p>\u9501\u548c\u591a\u7248\u672c\u6570\u636e\u662fInnoDB\u5b9e\u73b0\u4e00\u81f4\u6027\u8bfb\u548cISO\/ANIS SQL92\u9694\u79bb\u7ea7\u522b\u7684\u624b\u6bb5\uff0c\u56e0\u6b64\uff0c\u5728\u4e0d\u540c\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cInnoDB\u5904\u7406SQL\u65f6\u91c7\u7528\u7684\u4e00\u81f4\u6027\u8bfb\u7b56\u7565\u548c\u9700\u8981\u7684\u9501\u662f\u4e0d\u540c\u7684\u3002\uff08\u4e0b\u9762\u7684\u8868\u6765\u81ea\u300a\u6df1\u5165\u6d45\u51faMYSQL\u300b20.3.7\u8282\uff09<\/p>\n<pre>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>SQL<\/td>\r\n<td>\u6761\u4ef6<\/td>\r\n<td>Read Uncommitted<\/td>\r\n<td>Read Committed<\/td>\r\n<td>Repeatable Read<\/td>\r\n<td>Serializable<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>select<\/td>\r\n<td>\u76f8\u7b49<\/td>\r\n<td>None locks<\/td>\r\n<td>Consistenread\/None lock<\/td>\r\n<td>Consistenread\/None lock<\/td>\r\n<td>Share locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u8303\u56f4<\/td>\r\n<td>None locks<\/td>\r\n<td>Consistenread\/None lock<\/td>\r\n<td>Consistenread\/None lock<\/td>\r\n<td>Share Next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>update<\/td>\r\n<td>\u76f8\u7b49<\/td>\r\n<td>exclusive locks<\/td>\r\n<td>exclusive locks<\/td>\r\n<td>exclusive locks<\/td>\r\n<td>exclusive locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u8303\u56f4<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0\u00a0exclusive next-key<\/td>\r\n<td>\u00a0\u00a0exclusive next-key<\/td>\r\n<td>\u00a0\u00a0exclusive next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>insert<\/td>\r\n<td>N\/A<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>replace<\/td>\r\n<td>\u65e0\u952e\u51b2\u7a81<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u952e\u51b2\u7a81<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>delete<\/td>\r\n<td>\u76f8\u7b49<\/td>\r\n<td>\u00a0\u00a0exclusive locks<\/td>\r\n<td>\u00a0\u00a0exclusive locks<\/td>\r\n<td>\u00a0\u00a0exclusive locks<\/td>\r\n<td>\u00a0\u00a0exclusive locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u8303\u56f4<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>select ... from ... lock in share mode<\/td>\r\n<td>\u76f8\u7b49<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u8303\u56f4<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<td>\u00a0Share locks<\/td>\r\n<td>\u00a0Share Next-key<\/td>\r\n<td>\u00a0Share Next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>select...from... for update<\/td>\r\n<td>\u76f8\u7b49<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>\u8303\u56f4<\/td>\r\n<td>\u00a0exclusive locks<\/td>\r\n<td>exclusive locks<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<td>\u00a0exclusive next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>insert into...select...\uff08\u6307\u6e90\u8868\u9501\uff09<\/td>\r\n<td>innodb_locks_unsafe_for_binlog=0<\/td>\r\n<td>\u00a0share next-key<\/td>\r\n<td>\u00a0\u00a0share next-key<\/td>\r\n<td>\u00a0\u00a0share next-key<\/td>\r\n<td>\u00a0\u00a0share next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>innodb_locks_unsafe_for_binlog=1<\/td>\r\n<td>\u00a0None locks<\/td>\r\n<td>\u00a0Consistenread\/None lock<\/td>\r\n<td>\u00a0Consistenread\/None lock<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>create table... select ... \uff08\u6307\u6e90\u8868\u9501\uff09<\/td>\r\n<td>innodb_locks_unsafe_for_binlog=0<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><\/td>\r\n<td>innodb_locks_unsafe_for_binlog=1<\/td>\r\n<td>\u00a0\u00a0None locks<\/td>\r\n<td>\u00a0\u00a0Consistenread\/None lock<\/td>\r\n<td>\u00a0Consistenread\/None lock<\/td>\r\n<td>\u00a0Share next-key<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9501\u548c\u591a\u7248\u672c\u6570\u636e\u662fInnoDB\u5b9e\u73b0\u4e00\u81f4\u6027\u8bfb\u548cISO\/ANIS SQL92\u9694\u79bb\u7ea7\u522b\u7684\u624b\u6bb5\uff0c\u56e0\u6b64\uff0c\u5728\u4e0d\u540c\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cInnoDB\u5904\u7406SQL\u65f6\u91c7\u7528\u7684\u4e00\u81f4\u6027\u8bfb\u7b56\u7565\u548c\u9700\u8981&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.5x44.cn\/?p=862\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[43,41,42,44],"class_list":["post-862","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-consisten-read","tag-lock","tag-tx_isolation","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=862"}],"version-history":[{"count":8,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":924,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions\/924"}],"wp:attachment":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}