{"id":712,"date":"2020-06-14T23:21:34","date_gmt":"2020-06-14T15:21:34","guid":{"rendered":"https:\/\/blog.humh.cn\/?p=712"},"modified":"2020-06-14T23:21:34","modified_gmt":"2020-06-14T15:21:34","slug":"mysql%e4%b9%8btruncated-incorrect-double-value","status":"publish","type":"post","link":"https:\/\/blog.humh.cn\/?p=712","title":{"rendered":"mysql\u4e4b\u201cTruncated incorrect DOUBLE value\u201d"},"content":{"rendered":"\n<h4>\u4e00\u3001\u95ee\u9898\u590d\u73b0<\/h4>\n\n\n\n<p>\u6709\u4e00\u5f20\u8868\u4e2d\u67d0\u4e2a\u5b57\u6bb5number\u4e3achar\u7c7b\u578b\uff0c\u4f46\u5b9e\u9645\u5728\u7528where number= \uff1f\u65f6\uff0c\u4f20\u5165\u7684\u53c2\u6570\u4e3along\u7c7b\u578b\uff0c\u8fd9\u6837\u5bfc\u81f4\u4e86mysql\u9519\u8bef<\/p>\n\n\n\n<p>\u5f02\u5e38\u5806\u6808\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">org.springframework.dao.DataIntegrityViolationException:\n### Error updating database.  Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'iot_account                                 '\n### The error may involve cn.susoncloud.wisdomclass.usercenter.domain.repository.UserMapper.update-Inline\n### The error occurred while setting parameters\n### SQL: UPDATE user  SET password=?,                 update_user_id=?, update_user_name=?, update_time=?   WHERE  number= ?\n### Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'iot_account                     '\n; ]; Data truncation: Truncated incorrect DOUBLE value: 'iot_account                                 '; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'iot_account            '\n        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104)\n        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)\n        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)\n        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)\n        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)\n        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)\n        at com.sun.proxy.$Proxy103.update(Unknown Source)\n        at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294)\n        at com.baomidou.mybatisplus.core.override.PageMapperMethod.execute(PageMapperMethod.java:73)\n        at com.baomidou.mybatisplus.core.override.PageMapperProxy.invoke(PageMapperProxy.java:64)\n        at com.sun.proxy.$Proxy112.update(Unknown Source)\n        at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl.update(ServiceImpl.java:221)\n        at com.baomidou.mybatisplus.extension.service.impl.ServiceImpl$$FastClassBySpringCGLIB$$76535273.invoke(&lt;generated&gt;)<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/file.blog.humh.cn\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25.png\"><img width=\"929\" height=\"585\" class=\"wp-image-715 lazyload\" title=\"mysql\u4e4b\u201cTruncated incorrect DOUBLE value\u201d\" src=\"data:image\/gif;base64,R0lGODlhAgABAIAAALGxsQAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==\" data-src=\"https:\/\/file.blog.humh.cn\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25.png\" alt=\"https:\/\/file.blog.humh.cn\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25.png\" data-srcset=\"https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25.png 929w, https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25-300x189.png 300w, https:\/\/file.blog.humh.cn\/wp-content\/uploads\/2020\/06\/d2b5ca33bd970f64a6301fa75ae2eb22-25-768x484.png 768w\" sizes=\"(max-width: 929px) 100vw, 929px\"><\/a><\/figure><\/div>\n\n\n\n<h4>\u4e8c\u3001\u539f\u56e0\u5206\u6790\uff1a<\/h4>\n\n\n\n<p>\u5f53\u5b57\u6bb5\u7c7b\u578b\u5b9e\u9645\u4e3achar\uff0c\u4f46\u4f20\u5165\u7684\u503c\u5374\u4e3along\u65f6\uff0c\u4ecemysql\u884c\u4e3a\u9a8c\u8bc1\u6765\u770b\uff0cmysql\u4f1a\u5c06\u8868\u4e2d\u7684\u8be5\u5217\u503c\u5168\u90e8\u8f6c\u6362\u4e3a\u6570\u503c\u7c7b\u578b\uff0c\u7136\u540e\u518d\u53bbwhere\u5339\u914d\uff0c\u7136\u800c\u5982\u679c\u5217\u503c\u4e2d\u5b58\u5728\u5982\u201cabc\u201d\u8fd9\u6837\u7684\u503c\uff0c\u663e\u7136\u662f\u6ca1\u6709\u529e\u6cd5\u8f6c\u6210\u6570\u503c\u7c7b\u578b\u7684\uff0c\u6240\u4ee5\u5c31\u62a5\u4e86\u201c Truncated incorrect DOUBLE value\u201d\u8fd9\u6837\u7684\u9519\u8bef\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u5217\u503c\u90fd\u4e3a\u201c123\u201d\u7b49\u8fd9\u6837\u7684\u6570\u503c\u5b57\u7b26\u8868\u793a\u7684\u503c\uff0c\u90fd\u662f\u53ef\u4ee5\u8f6c\u6362\u6210\u529f\u7684\uff0c\u662f\u4e0d\u4f1a\u62a5\u9519\u7684\u3002\u5f53\u7136\u5982\u679c\u6211\u4eecwhere \u6761\u4ef6 \u5c5e\u6027\u503c\u5339\u914d\u65f6\u53c2\u6570\u4f20\u9012\u7684\u4e0e\u5b9e\u9645\u8868\u4e2d\u5217\u503c\u5c5e\u6027\u76f8\u540c\uff0c\u8fd9\u91cc\u5982where number = \u201c123\u201d\u800c\u4e0d\u662fwhere number = 123\uff0c\u90a3\u4e48\u4e5f\u4e0d\u4f1a\u62a5\u9519\uff0c\u56e0\u4e3a\u7c7b\u578b\u76f8\u540c\uff0cmysql\u4e0d\u4f1a\u8fdb\u884c\u7c7b\u578b\u8f6c\u6362\uff0c<\/p>\n\n\n\n<p>\u4e5f\u5c31\u4e0d\u4f1a\u51fa\u73b0\u8f6c\u6362\u7684\u9519\u8bef\u3002<\/p>\n\n\n\n<p>\u9664\u4e86\u8fd9\u79cd\u539f\u56e0\u5916\uff0c\u4f1a\u5bfc\u81f4\u8fd9\u79cd\u9519\u8bef\u3002\u8fd8\u6709\u4e00\u79cd\u7ecf\u5e38\u51fa\u73b0\u7684\u9519\u8bef\u60c5\u51b5\uff1a<\/p>\n\n\n\n<p>update tab set name = ? , sex = ? where id&nbsp;= ?&nbsp;<\/p>\n\n\n\n<p>\u5374\u5199\u6210\u4e86<\/p>\n\n\n\n<p>update tab set name = ? and sex = ? where id&nbsp;= ?&nbsp;<\/p>\n\n\n\n<p>\u90a3\u4e48\u4e5f\u4f1a\u5bfc\u81f4\u201c Truncated incorrect DOUBLE value\u201d\u8fd9\u6837\u7684\u9519\u8bef\u3002<\/p>\n\n\n\n<p>\u5176\u5b9e\uff0c\u7a76\u5176\u6839\u672c\uff0c\u4ece\u5b98\u65b9bug\u5355\u4e2d\u53ef\u4ee5\u627e\u5230\u8fd9\u4e00\u201cbug\u201d\uff08<a href=\"https:\/\/bugs.mysql.com\/bug.php?id=63112\">https:\/\/bugs.mysql.com\/bug.php?id=63112<\/a>\uff09\u5355\u5b50\u4e2d\u5f00\u53d1\u8005example\u975e\u5e38\u8be6\u7ec6\uff0c\u4f1a\u53d1\u73b0\u5bfc\u81f4\u8fd9\u4e00\u9519\u8bef\u7684\u51fa\u73b0\uff0c\u662f\u56e0\u4e3amysql sql_mode\u9ed8\u8ba4\u503c\u5bfc\u81f4\u7684\uff0c\u9ed8\u8ba4\u9075\u5faa\u4e25\u683c\u7684\u8bed\u6cd5\uff0c\u5f53\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u4f1aerror\uff0c\u5982\u679c\u91c7\u53d6\u975e\u4e25\u683c\u7684sql_mode \u7ea7\u522b\uff0c\u5c31\u4e0d\u4f1a\u629b\u51faerror\uff0c\u4ec5\u4ec5\u662fwarn\u4e86\uff0c\u6b63\u5e38\u6267\u884c\u4e86\u3002\u5bf9\u4e8e\u7c7b\u578b\u8f6c\u6362\uff0c\u662fmysql\u81ea\u8eab\u7684\u7b56\u7565\uff0c\u5b83\u4f1a\u8f6c\u6210\u8f6c\u6362\u53cc\u7cbe\u5ea6\u503c\u3002<\/p>\n\n\n\n<h4>\u4e09\u3001\u53c2\u8003<\/h4>\n\n\n\n<p>\u53c2\u8003 \u53ef\u80fd\u5bfc\u81f4\u7684\u9519\u8bef\u7c7b\u578b\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/3456258\/mysql-truncated-incorrect-double-value\">https:\/\/stackoverflow.com\/questions\/3456258\/mysql-truncated-incorrect-double-value<\/a><\/p>\n\n\n\n<p>\u53c2\u8003 mysql\u5b98\u65b9bug\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/bugs.mysql.com\/bug.php?id=63112\">https:\/\/bugs.mysql.com\/bug.php?id=63112<\/a><\/p>\n\n\n\n<p>\u53c2\u8003 mysql sql_mode \u89e3\u8bfb\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/www.cnblogs.com\/fireporsche\/p\/8618691.html\">https:\/\/www.cnblogs.com\/fireporsche\/p\/8618691.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u95ee\u9898\u590d\u73b0 \u6709\u4e00\u5f20\u8868\u4e2d\u67d0\u4e2a\u5b57\u6bb5number\u4e3achar\u7c7b\u578b\uff0c\u4f46\u5b9e\u9645\u5728\u7528where number= \uff1f\u65f6\uff0c\u4f20\u5165\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[52],"tags":[36],"_links":{"self":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/712"}],"collection":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=712"}],"version-history":[{"count":5,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions"}],"predecessor-version":[{"id":718,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=\/wp\/v2\/posts\/712\/revisions\/718"}],"wp:attachment":[{"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.humh.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}