登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情~
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
31
Star
32
Fork
224
openGauss
/
Plugin
代码
Issues
50
Pull Requests
1
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
【测试类型:SQL功能】【测试版本:6.0.0】insert ignore into与prepare结合,插入重复值导致数据库core
已验收
#I9F8F4
缺陷
li-xin12345
创建于
2024-04-09 16:58
【标题描述】:insert ignore into与prepare结合,插入重复值导致数据库core 【测试类型:SQL功能】【测试版本:6.0.0】insert ignore into与prepare结合,插入重复值导致数据库core 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): openEuler release 20.03 (LTS-SP3) Linux openeuler-arm-compile 4.19.90-2208.5.0.0164.oe1.aarch64 #1 SMP Wed Aug 24 07:05:36 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux 【测试环境】(单机/1主x备x级联备): 一主两备 【被测功能】: insert ignore into 【测试类型】: 兼容性 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 28fc03da) compiled at 2024-03-20 14:58:05 commit 0 last mr 【预置条件】: 兼容B库 【操作步骤】(请填写详细的操作步骤): ``` drop table if exists t_ignore_0037; create table t_ignore_0037(c1 int primary key, c2 fixed(5,2)); prepare insert_ignore(int,fixed(5,2)) as insert ignore into t_ignore_0037 values($1, $2); execute insert_ignore(0, 123.12); execute insert_ignore(0, 123.12); ``` 【预期输出】: 未插入,无error,降级为warning 【实际输出】: 插入重复值导致数据库core    【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): ``` (gdb) bt #0 0x0000aaabc1b919ac in sys_wait4 (ru=0x0, options=options@entry=1073741824, stat_addr=stat_addr@entry=0xfffc4f0b15ec, upid=upid@entry=3542351) at bbox_syscall_support.cpp:36 #1 sys_waitpid (pid=pid@entry=3542351, status=status@entry=0xfffc4f0b15ec, options=options@entry=1073741824) at bbox_syscall_support.cpp:516 #2 0x0000aaabc1b92da8 in BBOX_GetClonePidResult (iClonePid=iClonePid@entry=3542351, pstArgs=pstArgs@entry=0xfffc4f0b1670, iCloneErrno=iCloneErrno@entry=9) at bbox_threads.cpp:572 #3 0x0000aaabc1b930e8 in BBOX_GetAllThreads (enType=<optimized out>, pDone=pDone@entry=0xaaabc1b89c90 <BBOX_FinishDumpFile(void*)>, pDoneArgs=pDoneArgs@entry=0xfffc4f0b17b8, pCallback=<optimized out>) at bbox_threads.cpp:700 #4 0x0000aaabc1b89f4c in BBOX_CreateCoredump (file_name=0xfffc4f0b18e8 "/run/corefile//core-gaussdb-3540954-2024_04_09_16_49_31-bbox.lz4", file_name@entry=0x0) at bbox_create.cpp:440 #5 0x0000aaabc1b94a54 in bbox_handler (sig=11, si=0xfffc4f0b1e20, uc=<optimized out>) at gs_bbox.cpp:112 #6 bbox_handler (sig=11, si=0xfffc4f0b1e20, uc=<optimized out>) at gs_bbox.cpp:102 #7 <signal handler called> #8 check_violation (heap=0xfffc4c774150, index=index@entry=0xfffc4c7692c0, indexInfo=indexInfo@entry=0xfffc4a8b1c70, tupleid=tupleid@entry=0xfffc4f0b4c50, values=values@entry=0xfffc4f0b4d70, isnull=isnull@entry=0xfffc4f0b4c70, estate=estate@entry=0xfffc4a8c8050, newIndex=newIndex@entry=false, errorOK=<optimized out>, errorOK@entry=true, waitMode=<optimized out>, waitMode@entry=CHECK_WAIT, conflictInfo=<optimized out>, conflictInfo@entry=0xfffc4f0b4f10, partoid=<optimized out>, partoid@entry=0, bucketid=<optimized out>, conflictPartOid=<optimized out>, conflictPartOid@entry=0xfffc4f0b4f0c, conflictBucketid=<optimized out>, conflictBucketid@entry=0xfffc4f0b4f0a) at execUtils.cpp:2204 #9 0x0000aaabc1fb6db8 in ExecCheckIndexConstraints (slot=<optimized out>, estate=0xfffc4a8c8050, targetRel=targetRel@entry=0xfffc4c774150, p=p@entry=0x0, isgpiResult=isgpiResult@entry=0xfffc4f0b4f09, bucketId=bucketId@entry=-1, conflictInfo=conflictInfo@entry=0xfffc4f0b4f10, conflictPartOid=conflictPartOid@entry=0xfffc4f0b4f0c, conflictBucketid=<optimized out>, conflictBucketid@entry=0xfffc4f0b4f0a) at execUtils.cpp:1837 #10 0x0000aaabc2024b08 in InsertFusion::ExecInsert (this=0xfffc5e225650, rel=0xfffc4c774150, result_rel_info=0xfffc4a8b1a60) at opfusion_insert.cpp:307 #11 0x0000aaabc2025ff0 in InsertFusion::execute (this=0xfffc5e225650, max_rows=<optimized out>, completionTag=0xfffc4f0b8198 "") at opfusion_insert.cpp:451 #12 0x0000aaabc202ead4 in OpFusion::fusionExecute (this=<optimized out>, msg=msg@entry=0x0, completionTag=completionTag@entry=0xfffc4f0b8198 "", isTopLevel=isTopLevel@entry=false, isQueryCompleted=isQueryCompleted@entry=0x0) at opfusion.cpp:499 #13 0x0000aaabc2030f24 in OpFusion::process (op=op@entry=0, msg=msg@entry=0x0, completionTag=completionTag@entry=0xfffc4f0b8198 "", isTopLevel=isTopLevel@entry=false, isQueryCompleted=isQueryCompleted@entry=0x0) at opfusion.cpp:541 #14 0x0000fffc4ba274bc in ExecuteQuery (stmt=<optimized out>, intoClause=0x0, queryString=0xfffc5e22e050 "execute insert_ignore(0, 123.12);", params=0x0, dest=0xfffc5e22ed88, completionTag=0xfffc4f0b8198 "") at prepare.cpp:433 #15 0x0000fffc4ba867f0 in standard_ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b8198, dest=dest@entry=0xfffc5e22ed88, sent_to_remote=sent_to_remote@entry=false, completion_tag=completion_tag@entry=0xfffc4f0b8198 "", context=PROCESS_UTILITY_TOPLEVEL, context@entry=1326154136, isCTAS=isCTAS@entry=false) at plugin_utility.cpp:3299 #16 0x0000aaabc1f0e5a4 in standard_ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b8198, dest=0xfffc5e22ed88, dest@entry=0x1, sent_to_remote=false, sent_to_remote@entry=252, completion_tag=0xfffc4f0b8198 "", completion_tag@entry=0x1 <error: Cannot access memory at address 0x1>, context=context@entry=1326154136, isCTAS=false) at utility.cpp:2566 #17 0x0000fffde63785a8 in gsaudit_ProcessUtility_hook (processutility_cxt=0xfffc4f0b8198, dest=0x1, sentToRemote=252, completionTag=0x1 <error: Cannot access memory at address 0x1>, context=1326154136, isCTAS=<optimized out>) at gs_policy_plugin.cpp:819 #18 0x0000aaabc1f1663c in pgaudit_ProcessUtility (processutility_cxt=0xfffc4f0b7ca8, dest=<optimized out>, sentToRemote=<optimized out>, completionTag=<optimized out>, context=<optimized out>, isCTAS=<optimized out>) at auditfuncs.cpp:1419 #19 0x0000aaabc1f11c3c in ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b7ca8, dest=dest@entry=0xfffc5e22ed88, sent_to_remote=sent_to_remote@entry=false, completion_tag=completion_tag@entry=0xfffc4f0b8198 "", context=context@entry=PROCESS_UTILITY_TOPLEVEL, isCTAS=isCTAS@entry=false) at utility.cpp:1564 #20 0x0000aaabc1f04008 in PortalRunUtility (portal=portal@entry=0xfffc4d7d6270, utilityStmt=utilityStmt@entry=0xfffc5e22ec68, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1736 #21 0x0000aaabc1f06e44 in PortalRunMulti (portal=portal@entry=0xfffc4d7d6270, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, altdest=altdest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1915 #22 0x0000aaabc1f08338 in PortalRun (portal=portal@entry=0xfffc4d7d6270, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, altdest=altdest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1191 #23 0x0000aaabc1ef8704 in exec_simple_query (query_string=query_string@entry=0xfffc5e22e050 "execute insert_ignore(0, 123.12);", messageType=messageType@entry=QUERY_MESSAGE, msg=msg@entry=0xfffc4f0b8da8) at postgres.cpp:3040 --Type <RET> for more, q to quit, c to continue without paging--c #24 0x0000aaabc1f00248 in PostgresMain (argc=<optimized out>, argv=argv@entry=0xfffc61586010, dbname=<optimized out>, username=<optimized out>) at postgres.cpp:9160 #25 0x0000aaabc1e560fc in BackendRun (port=port@entry=0xfffc4f0ba578) at postmaster.cpp:9584 #26 0x0000aaabc1e83718 in GaussDbThreadMain<(knl_thread_role)1> (arg=<optimized out>) at postmaster.cpp:11955 #27 0x0000aaabc1e56190 in InternalThreadFunc (args=<optimized out>) at postmaster.cpp:14795 #28 0x0000fffde663878c in ?? () from /usr/lib64/libpthread.so.0 #29 0x0000fffde658511c in ?? () from /usr/lib64/libc.so.6 (gdb) ``` 【测试代码】:
【标题描述】:insert ignore into与prepare结合,插入重复值导致数据库core 【测试类型:SQL功能】【测试版本:6.0.0】insert ignore into与prepare结合,插入重复值导致数据库core 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): openEuler release 20.03 (LTS-SP3) Linux openeuler-arm-compile 4.19.90-2208.5.0.0164.oe1.aarch64 #1 SMP Wed Aug 24 07:05:36 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux 【测试环境】(单机/1主x备x级联备): 一主两备 【被测功能】: insert ignore into 【测试类型】: 兼容性 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 28fc03da) compiled at 2024-03-20 14:58:05 commit 0 last mr 【预置条件】: 兼容B库 【操作步骤】(请填写详细的操作步骤): ``` drop table if exists t_ignore_0037; create table t_ignore_0037(c1 int primary key, c2 fixed(5,2)); prepare insert_ignore(int,fixed(5,2)) as insert ignore into t_ignore_0037 values($1, $2); execute insert_ignore(0, 123.12); execute insert_ignore(0, 123.12); ``` 【预期输出】: 未插入,无error,降级为warning 【实际输出】: 插入重复值导致数据库core    【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): ``` (gdb) bt #0 0x0000aaabc1b919ac in sys_wait4 (ru=0x0, options=options@entry=1073741824, stat_addr=stat_addr@entry=0xfffc4f0b15ec, upid=upid@entry=3542351) at bbox_syscall_support.cpp:36 #1 sys_waitpid (pid=pid@entry=3542351, status=status@entry=0xfffc4f0b15ec, options=options@entry=1073741824) at bbox_syscall_support.cpp:516 #2 0x0000aaabc1b92da8 in BBOX_GetClonePidResult (iClonePid=iClonePid@entry=3542351, pstArgs=pstArgs@entry=0xfffc4f0b1670, iCloneErrno=iCloneErrno@entry=9) at bbox_threads.cpp:572 #3 0x0000aaabc1b930e8 in BBOX_GetAllThreads (enType=<optimized out>, pDone=pDone@entry=0xaaabc1b89c90 <BBOX_FinishDumpFile(void*)>, pDoneArgs=pDoneArgs@entry=0xfffc4f0b17b8, pCallback=<optimized out>) at bbox_threads.cpp:700 #4 0x0000aaabc1b89f4c in BBOX_CreateCoredump (file_name=0xfffc4f0b18e8 "/run/corefile//core-gaussdb-3540954-2024_04_09_16_49_31-bbox.lz4", file_name@entry=0x0) at bbox_create.cpp:440 #5 0x0000aaabc1b94a54 in bbox_handler (sig=11, si=0xfffc4f0b1e20, uc=<optimized out>) at gs_bbox.cpp:112 #6 bbox_handler (sig=11, si=0xfffc4f0b1e20, uc=<optimized out>) at gs_bbox.cpp:102 #7 <signal handler called> #8 check_violation (heap=0xfffc4c774150, index=index@entry=0xfffc4c7692c0, indexInfo=indexInfo@entry=0xfffc4a8b1c70, tupleid=tupleid@entry=0xfffc4f0b4c50, values=values@entry=0xfffc4f0b4d70, isnull=isnull@entry=0xfffc4f0b4c70, estate=estate@entry=0xfffc4a8c8050, newIndex=newIndex@entry=false, errorOK=<optimized out>, errorOK@entry=true, waitMode=<optimized out>, waitMode@entry=CHECK_WAIT, conflictInfo=<optimized out>, conflictInfo@entry=0xfffc4f0b4f10, partoid=<optimized out>, partoid@entry=0, bucketid=<optimized out>, conflictPartOid=<optimized out>, conflictPartOid@entry=0xfffc4f0b4f0c, conflictBucketid=<optimized out>, conflictBucketid@entry=0xfffc4f0b4f0a) at execUtils.cpp:2204 #9 0x0000aaabc1fb6db8 in ExecCheckIndexConstraints (slot=<optimized out>, estate=0xfffc4a8c8050, targetRel=targetRel@entry=0xfffc4c774150, p=p@entry=0x0, isgpiResult=isgpiResult@entry=0xfffc4f0b4f09, bucketId=bucketId@entry=-1, conflictInfo=conflictInfo@entry=0xfffc4f0b4f10, conflictPartOid=conflictPartOid@entry=0xfffc4f0b4f0c, conflictBucketid=<optimized out>, conflictBucketid@entry=0xfffc4f0b4f0a) at execUtils.cpp:1837 #10 0x0000aaabc2024b08 in InsertFusion::ExecInsert (this=0xfffc5e225650, rel=0xfffc4c774150, result_rel_info=0xfffc4a8b1a60) at opfusion_insert.cpp:307 #11 0x0000aaabc2025ff0 in InsertFusion::execute (this=0xfffc5e225650, max_rows=<optimized out>, completionTag=0xfffc4f0b8198 "") at opfusion_insert.cpp:451 #12 0x0000aaabc202ead4 in OpFusion::fusionExecute (this=<optimized out>, msg=msg@entry=0x0, completionTag=completionTag@entry=0xfffc4f0b8198 "", isTopLevel=isTopLevel@entry=false, isQueryCompleted=isQueryCompleted@entry=0x0) at opfusion.cpp:499 #13 0x0000aaabc2030f24 in OpFusion::process (op=op@entry=0, msg=msg@entry=0x0, completionTag=completionTag@entry=0xfffc4f0b8198 "", isTopLevel=isTopLevel@entry=false, isQueryCompleted=isQueryCompleted@entry=0x0) at opfusion.cpp:541 #14 0x0000fffc4ba274bc in ExecuteQuery (stmt=<optimized out>, intoClause=0x0, queryString=0xfffc5e22e050 "execute insert_ignore(0, 123.12);", params=0x0, dest=0xfffc5e22ed88, completionTag=0xfffc4f0b8198 "") at prepare.cpp:433 #15 0x0000fffc4ba867f0 in standard_ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b8198, dest=dest@entry=0xfffc5e22ed88, sent_to_remote=sent_to_remote@entry=false, completion_tag=completion_tag@entry=0xfffc4f0b8198 "", context=PROCESS_UTILITY_TOPLEVEL, context@entry=1326154136, isCTAS=isCTAS@entry=false) at plugin_utility.cpp:3299 #16 0x0000aaabc1f0e5a4 in standard_ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b8198, dest=0xfffc5e22ed88, dest@entry=0x1, sent_to_remote=false, sent_to_remote@entry=252, completion_tag=0xfffc4f0b8198 "", completion_tag@entry=0x1 <error: Cannot access memory at address 0x1>, context=context@entry=1326154136, isCTAS=false) at utility.cpp:2566 #17 0x0000fffde63785a8 in gsaudit_ProcessUtility_hook (processutility_cxt=0xfffc4f0b8198, dest=0x1, sentToRemote=252, completionTag=0x1 <error: Cannot access memory at address 0x1>, context=1326154136, isCTAS=<optimized out>) at gs_policy_plugin.cpp:819 #18 0x0000aaabc1f1663c in pgaudit_ProcessUtility (processutility_cxt=0xfffc4f0b7ca8, dest=<optimized out>, sentToRemote=<optimized out>, completionTag=<optimized out>, context=<optimized out>, isCTAS=<optimized out>) at auditfuncs.cpp:1419 #19 0x0000aaabc1f11c3c in ProcessUtility (processutility_cxt=processutility_cxt@entry=0xfffc4f0b7ca8, dest=dest@entry=0xfffc5e22ed88, sent_to_remote=sent_to_remote@entry=false, completion_tag=completion_tag@entry=0xfffc4f0b8198 "", context=context@entry=PROCESS_UTILITY_TOPLEVEL, isCTAS=isCTAS@entry=false) at utility.cpp:1564 #20 0x0000aaabc1f04008 in PortalRunUtility (portal=portal@entry=0xfffc4d7d6270, utilityStmt=utilityStmt@entry=0xfffc5e22ec68, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1736 #21 0x0000aaabc1f06e44 in PortalRunMulti (portal=portal@entry=0xfffc4d7d6270, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, altdest=altdest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1915 #22 0x0000aaabc1f08338 in PortalRun (portal=portal@entry=0xfffc4d7d6270, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true, dest=dest@entry=0xfffc5e22ed88, altdest=altdest@entry=0xfffc5e22ed88, completionTag=completionTag@entry=0xfffc4f0b8198 "") at pquery.cpp:1191 #23 0x0000aaabc1ef8704 in exec_simple_query (query_string=query_string@entry=0xfffc5e22e050 "execute insert_ignore(0, 123.12);", messageType=messageType@entry=QUERY_MESSAGE, msg=msg@entry=0xfffc4f0b8da8) at postgres.cpp:3040 --Type <RET> for more, q to quit, c to continue without paging--c #24 0x0000aaabc1f00248 in PostgresMain (argc=<optimized out>, argv=argv@entry=0xfffc61586010, dbname=<optimized out>, username=<optimized out>) at postgres.cpp:9160 #25 0x0000aaabc1e560fc in BackendRun (port=port@entry=0xfffc4f0ba578) at postmaster.cpp:9584 #26 0x0000aaabc1e83718 in GaussDbThreadMain<(knl_thread_role)1> (arg=<optimized out>) at postmaster.cpp:11955 #27 0x0000aaabc1e56190 in InternalThreadFunc (args=<optimized out>) at postmaster.cpp:14795 #28 0x0000fffde663878c in ?? () from /usr/lib64/libpthread.so.0 #29 0x0000fffde658511c in ?? () from /usr/lib64/libc.so.6 (gdb) ``` 【测试代码】:
评论 (
4
)
登录
后才可以发表评论
状态
已验收
待办的
已确认
已答复
已取消
挂起
修复中
已完成
待回归
测试中
已验收
负责人
未设置
pengjiong
totaj
负责人
协作者
+负责人
+协作者
标签
sig/plugin
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(3)
1
https://gitee.com/opengauss/Plugin.git
git@gitee.com:opengauss/Plugin.git
opengauss
Plugin
Plugin
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册