-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ON DUPLICATE KEY UPDATE not work #8934
Comments
Thanks for your report, @devin-zhao ! I'll take a look. |
Hi @devin-zhao ,
What did you see exactly?
|
@jackysp update info
execute sql:
|
Thanks, @devin-zhao !
It may be caused by |
@jackysp it will be slient? no solution? |
Hi @devin-zhao , |
Bug Report
Please answer these questions before submitting your issue. Thanks!
create table:
CREATE TABLE
video_comment
(video_id
bigint(20) NOT NULL COMMENT '视频id',comment_id
bigint(20) NOT NULL DEFAULT 0 COMMENT '评论id',content
varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '评论内容',publish_time
timestamp(0) NULL DEFAULT NULL COMMENT '评论时间',commenter_id
bigint(20) NOT NULL DEFAULT 0 COMMENT '用户唯一标识',is_invalid
tinyint(3) NOT NULL DEFAULT 1 COMMENT '是否为有效评论 1有效 0无效',is_owner_published
tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否是视频拥有者发布的评论 0不是 1是',created_at
timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '抓取时间',sentiment
float NOT NULL DEFAULT 0,PRIMARY KEY (
comment_id
) USING BTREE,INDEX
idx_vid_time_cid
(video_id
,publish_time
,commenter_id
) USING BTREE) CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '视频评论表';
execute sql:
INSERT INTO
video_comment
(video_id
,sentiment
,comment_id
) VALUES (974712634567720044, 0.1234, 4109668666), (974712634567720044, 0.0167704, 4109668667) ON DUPLICATE KEY UPDATEsentiment
= VALUES(sentiment
)insert success
execute sql:
INSERT INTO
video_comment
(video_id
,sentiment
,comment_id
) VALUES (974712634567720044, 0.2222, 4109668666), (974712634567720044, 0.2222, 4109668667) ON DUPLICATE KEY UPDATEsentiment
= VALUES(sentiment
)What did you expect to see?
the sentiment field value are changed to 0.2222
What did you see instead?
no field value are changed
What version of TiDB are you using (
tidb-server -V
or runselect tidb_version();
on TiDB)?Release Version: v2.1.2-1-g8ba8096
Git Commit Hash: 8ba8096
Git Branch: release-2.1
UTC Build Time: 2018-12-21 03:45:55
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
The text was updated successfully, but these errors were encountered: