已关闭
[Bug]: insert on conflict do update 新插入更新值与同时新插入的数据一致 openGauss执行结果与pg不一致 #8260
liuzhen001创建于  7月6日关闭于  8月15日
liuzhen001
liuzhen001成员
7月6日 创建

测试类型

SQL功能

测试版本

7.0.0LTS

问题描述

操作系统和硬件信息

image.png

测试环境

企业版主备

被测功能

预置条件

操作步骤

\echo '\n=== 场景2:批量插入中更新 Key 与待插入数据冲突 ===';

CREATE TABLE test_scene2 (
    key INT PRIMARY KEY,
    fruit TEXT,
    quantity INT
);

INSERT INTO test_scene2 (key, fruit, quantity) VALUES 
    (1, 'Apple', 10);

-- 验证SQL:预期失败
INSERT INTO test_scene2 (key, fruit, quantity) VALUES 
    (1, 'Cherry', 30),
    (3, 'Durian', 40)
ON CONFLICT (key) 
DO UPDATE SET 
    key = 3,
    fruit = EXCLUDED.fruit,
    quantity = EXCLUDED.quantity;

-- 验证数据未被修改
SELECT * FROM test_scene2 ORDER BY key;

预期输出

实际输出

opengauss pg兼容性数据库
image.png
pg数据库
image.png

日志信息

image.png

提单组织

测试团队

测试代码

likedislike
liuzhen001liuzhen001成员
7月6日 添加了label:bug
opengauss_bot
opengauss_bot成员
7月6日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
7月6日 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
7月6日 添加了label:sig/StorageEngine,sig/AI,sig/CM,sig/CloudNative,sig/SecurityTechnology,sig/SQLEngine
opengauss_bot
opengauss_bot成员
7月6日 评论:

Welcome To openGauss Community

Hey @liuzhen001 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zjh_hw .

likedislike
liuzhen001liuzhen001成员
7月6日 关联了看板:openGauss 7.0.0-LTS
liuzhen001liuzhen001成员
7月6日 将 zhangxubo 设为负责人
liuzhen001liuzhen001成员
7月6日 移除了负责人 TestManager
liuzhen001liuzhen001成员
7月6日 修改标题为 “[Bug]: insert on conflict do update 新插入更新为新插入的 openGauss执行结果与pg不一致”,原标题为“[Bug]: insert on conflict do update 新插入的本身存在冲突 openGauss执行结果与pg不一致”
liuzhen001liuzhen001成员
7月6日 修改标题为 “[Bug]: insert on conflict do update 新插入更新值与同时新插入的数据一致 openGauss执行结果与pg不一致”,原标题为“[Bug]: insert on conflict do update 新插入更新为新插入的 openGauss执行结果与pg不一致”
liuzhen001liuzhen001成员
7月27日 issue优先级由 无优先级 改变为 主要
liuzhen001liuzhen001成员
7月27日 issue优先级由 主要 改变为 严重
sunquanchengsunquancheng
7月31日 关联了pull request:fix(sql) #8261 insert on conflict do update批量内部更新冲突行为和PG一致
sunquancheng
sunquancheng
7月31日 评论:

同 #8261

/Users/sunquancheng/Library/Containers/com.tencent.xinWeChat/Data/Documents/xwechat_files/wxid_ytpl5t0ntblg21_9789/temp/InputTemp/2d30cb12-a487-4553-8f23-98fbb07ee154.png2d30cb12-a487-4553-8f23-98fbb07ee154.png

likedislike
ywzq1161327784ywzq1161327784成员
8月10日 issue状态由 待办的 改变为 已完成
chendong76chendong76成员
8月12日 issue状态由 已完成 改变为 待回归
liuzhen001
liuzhen001成员
8月15日 评论:

回归版本:7.0.0LTS B018:
回归结论:回归通过
回归过程:
image.png

likedislike
liuzhen001liuzhen001成员
8月15日 issue状态由 待回归 改变为 已验收
liuzhen001liuzhen001成员
8月15日 关闭了 issue