{"id":5396,"date":"2020-07-30T00:15:27","date_gmt":"2020-07-29T16:15:27","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5396"},"modified":"2020-07-30T00:15:27","modified_gmt":"2020-07-29T16:15:27","slug":"mysql-bug-insert-into-on-duplicate-key-update-%e8%af%ad%e6%b3%95%e6%9b%b4%e6%96%b0-text-blob-%e5%a4%a7%e5%ad%97%e6%ae%b5%e5%af%bc%e8%87%b4-mysql-crash","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5396","title":{"rendered":"MySQL Bug insert into on duplicate key update \u8bed\u6cd5\u66f4\u65b0 text blob \u5927\u5b57\u6bb5\u5bfc\u81f4 MySQL crash"},"content":{"rendered":"<div>\n<h2>MySQL \u505a\u7684\u65f6\u95f4\u957f\u4e86\uff0c\u5c31\u6709\u53ef\u80fd\u591a\u6b21\u9047\u5230\u76f8\u540c\u7684 Bug\uff0c\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u518d\u9047\u5230\uff0c\u80fd\u591f\u53c2\u8003\u3002<\/h2>\n<\/div>\n<div>\n<div>\n<h5>1. \u80cc\u666f<\/h5>\n<p>\u4e1a\u52a1\u6267\u884c SQL \u5bfc\u81f4 MySQL \u8fdb\u7a0b Crash\uff0c\u505a\u6545\u969c\u5207\u6362\u540e\uff0c\u65b0\u7684\u4e3b\u5e93\u53c8 Crash \u4e86\u3002\u67e5\u770b MySQL \u9519\u8bef\u65e5\u5fd7\uff0c\u53d1\u73b0\u591a\u6b21 Crash \u65f6\u7684\u5806\u6808\u76f8\u540c\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>Thread pointer: 0x7fb49b866000\nAttempting backtrace. You can use the following information to find out\nwhere mysqld died. If you see no messages after this, something went\nterribly wrong...\nstack_bottom = 7fb4bf979be8 thread_stack 0x80000\n\/usr\/local\/mysql\/bin\/mysqld(my_print_stacktrace+0x2c)[0xed36bc]\n\/usr\/local\/mysql\/bin\/mysqld(handle_fatal_signal+0x461)[0x7a26e1]\n\/lib64\/libpthread.so.0[0x369ea0f7e0]\n\/usr\/local\/mysql\/bin\/mysqld(_ZN10Field_blob15copy_blob_valueEP11st_mem_root+0x28)[0x7e6298]\n\/usr\/local\/mysql\/bin\/mysqld(_Z25mysql_prepare_blob_valuesP3THDR4ListI4ItemEP11st_mem_root+0x2b8)[0xe1c748]\n\/usr\/local\/mysql\/bin\/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0x9c0)[0xe1d450]\n\/usr\/local\/mysql\/bin\/mysqld(_ZN14Sql_cmd_insert12mysql_insertEP3THDP10TABLE_LIST+0x825)[0xe1dec5]\n\/usr\/local\/mysql\/bin\/mysqld(_ZN14Sql_cmd_insert7executeEP3THD+0xc2)[0xe1e702]\n\/usr\/local\/mysql\/bin\/mysqld(_Z21mysql_execute_commandP3THDb+0x18d7)[0xcad217]\n\/usr\/local\/mysql\/bin\/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x5d5)[0xcb3385]\n\/usr\/local\/mysql\/bin\/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xaba)[0xcb3eca]\n\/usr\/local\/mysql\/bin\/mysqld(_Z10do_commandP3THD+0x1b7)[0xcb5917]\n\/usr\/local\/mysql\/bin\/mysqld(_Z26threadpool_process_requestP3THD+0xc7)[0xd5a267]\n\/usr\/local\/mysql\/bin\/mysqld[0xd6979e]\n\/usr\/local\/mysql\/bin\/mysqld(pfs_spawn_thread+0x1b4)[0x123cf24]\n\/lib64\/libpthread.so.0[0x369ea07aa1]\n\/lib64\/libc.so.6(clone+0x6d)[0x369e2e893d]\n<\/pre>\n<p>\u53e6\u5916\uff0c\u673a\u5668\u4e0a\u8fd8\u4fdd\u5b58\u4e86 Crash \u65f6\u4ea7\u751f\u7684 core \u6587\u4ef6\uff0cgdb \u5206\u6790 core \u6587\u4ef6\uff0c\u627e\u5230\u4e86 Crash \u65f6\u6b63\u5728\u6267\u884c\u7684 SQL\uff0c\u662f\u4e00\u6761 insert into on duplicate key update \u7c7b\u578b\u7684\u7684 SQL\u3002\u5206\u6790\u8868\u7ed3\u6784\uff0c\u53d1\u73b0\u8868\u4e2d\u542b\u6709 text \u7c7b\u578b\u7684\u5b57\u6bb5\u3002\u53e6\u5916\u8bf4\u660e\u4e00\u4e0b\uff0cMySQL \u7248\u672c\u4e3a Percona Server for MySQL 5.7.19\u3002<\/p>\n<h5>2. \u539f\u56e0\u5206\u6790<\/h5>\n<p>\u7ed3\u5408\u4ee5\u4e0a\u9519\u8bef\u5806\u6808\u3001SQL\u3001\u8868\u7ed3\u6784\u7b49\u4fe1\u606f\uff0c\u5728 MySQL Bug \u5217\u8868\u4e2d\u641c\u7d22\u5230\u76f8\u5173 Bug\uff0c\u5982\u4e0b\uff1a<br \/>\n<a href=\\\"https:\/\/bugs.mysql.com\/bug.php?id=79243\\\">https:\/\/bugs.mysql.com\/bug.php?id=79243<\/a><br \/>\n\u8be5 Bug \u53d1\u751f\u6761\u4ef6\uff1a<\/p>\n<ol>\n<li>\u8868\u4e2d\u5305\u542b text, blob \u7b49\u5927\u5b57\u6bb5\u7c7b\u578b<\/li>\n<li>\u4f7f\u7528 insert into on duplicate key update \u66f4\u65b0\u6570\u636e<\/li>\n<\/ol>\n<p>\u8be5 Bug \u4ece 5.7.9 \u7248\u672c\u88ab\u63d0\u51fa\u6765\uff0c\u5728 5.7.16\uff0c 5.7.19\uff0c5.7.21 \u90fd\u6709\u51fa\u73b0\u8fc7\uff0c\u5b98\u65b9\u6587\u6863\u4e0a\u8bf4 5.7.19 \u5df2\u4fee\u590d\uff0c\u4f46\u662f\u4fee\u590d\u7684\u5e76\u4e0d\u5f7b\u5e95\uff0c\u5728 5.7.19\uff0c 5.7.21 \u76f8\u7ee7\u590d\u73b0\uff0c\u5b98\u65b9\u7ed9\u51fa\u7684\u6700\u540e\u4fee\u590d\u7248\u672c\u662f 5.7.22\u3002<\/p>\n<h5>3. \u89e3\u51b3\u65b9\u6848<\/h5>\n<ol>\n<li>\u5347\u7ea7 MySQL \u5230\u6700\u65b0\u7248\u672c\uff0c\u6bd4\u5982\u76ee\u524d 5.7 \u6700\u65b0\u7248\u672c\u4e3a 5.7.30\uff0c 8.0 \u6700\u65b0\u7248\u672c\u4e3a 8.0.20\u3002<\/li>\n<li>\u5982\u679c\u4e0d\u65b9\u4fbf\u5347\u7ea7 MySQL \u7248\u672c\uff0c\u53ef\u4ee5\u8003\u8651\u4fee\u6539\u8868\u5b57\u6bb5\u7c7b\u578b\uff0c\u5c06 text\uff0cblob \u5927\u5b57\u6bb5\u7c7b\u578b\u7528\u5176\u4ed6\u7c7b\u578b\u66ff\u4ee3\uff0c\u6bd4\u5982 varchar\u3002<\/li>\n<li>\u4fee\u6539 SQL\uff0c\u5c06 insert into on duplicate key update \u6362\u6210\u5176\u4ed6\u8bed\u6cd5\uff0c\u6bd4\u5982 replace into\uff0c\u5f53\u7136 replace into \u672c\u8eab\u5728\u4e00\u4e9b\u7248\u672c\u4e2d\u4e5f\u6709\u4e00\u4e9b\u95ee\u9898,<\/li>\n<\/ol>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MySQL \u505a\u7684\u65f6\u95f4\u957f\u4e86\uff0c\u5c31\u6709\u53ef\u80fd\u591a\u6b21\u9047\u5230\u76f8\u540c\u7684 Bug\uff0c\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u518d\u9047\u5230\uff0c\u80fd\u591f\u53c2\u8003\u3002 1. \u80cc\u666f &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5396\"> <span class=\"screen-reader-text\">MySQL Bug insert into on duplicate key update \u8bed\u6cd5\u66f4\u65b0 text blob \u5927\u5b57\u6bb5\u5bfc\u81f4 MySQL crash<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"MySQL \u505a\u7684\u65f6\u95f4\u957f\u4e86\uff0c\u5c31\u6709\u53ef\u80fd\u591a\u6b21\u9047\u5230\u76f8\u540c\u7684 Bug\uff0c\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u518d\u9047\u5230\uff0c\u80fd\u591f\u53c2\u8003\u3002 1. \u80cc\u666f&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5396"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5396"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5396\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5396"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}