登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
就在本周六,成都站 Gitee Talk | 模力方舟 AI 应用开发沙龙抢占最后席位!聚焦 AI 开发全链路,结识技术同频人~
代码拉取完成,页面将自动刷新
开源项目
>
数据库相关
>
数据库服务
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
442
Star
1.5K
Fork
1.8K
openGauss
/
openGauss-server
代码
Issues
964
Pull Requests
165
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
【海量】【ustore】【闪回】外键不支持闪回表,支持闪回查询当前csn
已取消
#IA4YXR
缺陷
cathyli
创建于
2024-06-12 19:28
<!-- #请认真填写以下信息,否则可能由于无法定位,导致issue无法解决而被取消 --> 【标题描述】:外键不支持闪回表,但是支持闪回查询 【测试类型:SQL功能/存储功能/接口功能/工具功能/性能/并发/压力长稳/故障注入/安全/资料/编码规范】【测试版本:x.x.x】 问题描述 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):  【测试环境】(单机/1主x备x级联备): 单机 【被测功能】: ustore-闪回 【测试类型】: 功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 982a7bec) compiled at 2024-05-29 09:11:24 commit o last mr 【预置条件】: 【操作步骤】(请填写详细的操作步骤): 1. --创建记录函数和记录表,方便获取时间戳和csn drop table t_timecapsule_test_tmp; create table t_timecapsule_test_tmp(id int, snaptime timestamptz, snapcsn bigint); CREATE OR REPLACE FUNCTION findCsn(int8) RETURNS INTEGER LANGUAGE plpgsql AS $BODY$ declare count integer; begin count = (select snapcsn from t_timecapsule_test_tmp where id = $1); return count; end; $BODY$; CREATE OR REPLACE FUNCTION findTime(int8) RETURNS timestamptz LANGUAGE plpgsql AS $BODY$ declare count timestamptz; begin count = (select snaptime from t_timecapsule_test_tmp where id = $1); return count; end; $BODY$; 2、参数设置 alter system set enable_recyclebin=on; alter system set recyclebin_retention_time=10000; alter system set undo_retention_time=10000; 3、创建表和数据 --清理历史的无效csn数据 truncate t_timecapsule_test_tmp; --添加各类约束--主键约束、外键约束、唯一约束、check\null\not null约束、default drop table t9; drop table t9_foreign; create table t9_foreign(id serial primary key,col varchar(20) not null unique)with(storage_type=ustore); create table t9( c1 int primary key, c2 number not null, c3 varchar(20) not null unique default 'null', c4 bigint check (c4>5), c5 int, c6 int, c7 text, constraint f1 foreign key (c5) references t9_foreign(id), constraint f2 foreign key (c6) references t9(c1) )with(storage_type=ustore); select pg_sleep(4); insert into t_timecapsule_test_tmp select 1, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; insert into t9_foreign(col) values('text'||generate_series(1,10)); select pg_sleep(4); insert into t_timecapsule_test_tmp select 2, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; insert into t9 values ( generate_series(1,10), generate_series(1,10), 'var'||generate_series(1,10), generate_series(6,10), generate_series(1,10), generate_series(1,10), 'text'||generate_series(1,10)); select pg_sleep(4); insert into t_timecapsule_test_tmp select 3, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; 4、执行闪回查询/闪回表 select * from t9 timecapsule csn findCsn(1); select * from t9 timecapsule timestamp findTime(1); timecapsule table t9 to csn findCsn(1); timecapsule table t9 to timestamp findTime(1); select * from t9 timecapsule csn findCsn(2); select * from t9 timecapsule timestamp findTime(2); timecapsule table t9 to csn findCsn(2); timecapsule table t9 to timestamp findTime(2); select * from t9 timecapsule csn findCsn(3); select * from t9 timecapsule timestamp findTime(3); timecapsule table t9 to csn findCsn(3); timecapsule table t9 to timestamp findTime(3); 【预期输出】: 闪回查询和闪回表均执行报错 【实际输出】: 1、前2次的闪回查询未报错而是返回空   2、最后csn和时间戳的闪回查询未报错,并且查询不为空  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
<!-- #请认真填写以下信息,否则可能由于无法定位,导致issue无法解决而被取消 --> 【标题描述】:外键不支持闪回表,但是支持闪回查询 【测试类型:SQL功能/存储功能/接口功能/工具功能/性能/并发/压力长稳/故障注入/安全/资料/编码规范】【测试版本:x.x.x】 问题描述 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):  【测试环境】(单机/1主x备x级联备): 单机 【被测功能】: ustore-闪回 【测试类型】: 功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 982a7bec) compiled at 2024-05-29 09:11:24 commit o last mr 【预置条件】: 【操作步骤】(请填写详细的操作步骤): 1. --创建记录函数和记录表,方便获取时间戳和csn drop table t_timecapsule_test_tmp; create table t_timecapsule_test_tmp(id int, snaptime timestamptz, snapcsn bigint); CREATE OR REPLACE FUNCTION findCsn(int8) RETURNS INTEGER LANGUAGE plpgsql AS $BODY$ declare count integer; begin count = (select snapcsn from t_timecapsule_test_tmp where id = $1); return count; end; $BODY$; CREATE OR REPLACE FUNCTION findTime(int8) RETURNS timestamptz LANGUAGE plpgsql AS $BODY$ declare count timestamptz; begin count = (select snaptime from t_timecapsule_test_tmp where id = $1); return count; end; $BODY$; 2、参数设置 alter system set enable_recyclebin=on; alter system set recyclebin_retention_time=10000; alter system set undo_retention_time=10000; 3、创建表和数据 --清理历史的无效csn数据 truncate t_timecapsule_test_tmp; --添加各类约束--主键约束、外键约束、唯一约束、check\null\not null约束、default drop table t9; drop table t9_foreign; create table t9_foreign(id serial primary key,col varchar(20) not null unique)with(storage_type=ustore); create table t9( c1 int primary key, c2 number not null, c3 varchar(20) not null unique default 'null', c4 bigint check (c4>5), c5 int, c6 int, c7 text, constraint f1 foreign key (c5) references t9_foreign(id), constraint f2 foreign key (c6) references t9(c1) )with(storage_type=ustore); select pg_sleep(4); insert into t_timecapsule_test_tmp select 1, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; insert into t9_foreign(col) values('text'||generate_series(1,10)); select pg_sleep(4); insert into t_timecapsule_test_tmp select 2, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; insert into t9 values ( generate_series(1,10), generate_series(1,10), 'var'||generate_series(1,10), generate_series(6,10), generate_series(1,10), generate_series(1,10), 'text'||generate_series(1,10)); select pg_sleep(4); insert into t_timecapsule_test_tmp select 3, now(), int8in(xidout(next_csn)) from gs_get_next_xid_csn(); select * from t_timecapsule_test_tmp; 4、执行闪回查询/闪回表 select * from t9 timecapsule csn findCsn(1); select * from t9 timecapsule timestamp findTime(1); timecapsule table t9 to csn findCsn(1); timecapsule table t9 to timestamp findTime(1); select * from t9 timecapsule csn findCsn(2); select * from t9 timecapsule timestamp findTime(2); timecapsule table t9 to csn findCsn(2); timecapsule table t9 to timestamp findTime(2); select * from t9 timecapsule csn findCsn(3); select * from t9 timecapsule timestamp findTime(3); timecapsule table t9 to csn findCsn(3); timecapsule table t9 to timestamp findTime(3); 【预期输出】: 闪回查询和闪回表均执行报错 【实际输出】: 1、前2次的闪回查询未报错而是返回空   2、最后csn和时间戳的闪回查询未报错,并且查询不为空  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
评论 (
4
)
登录
后才可以发表评论
状态
已取消
待办的
已确认
已答复
已取消
挂起
修复中
已完成
待回归
测试中
已验收
负责人
未设置
孙德超
sundechao2
负责人
协作者
+负责人
+协作者
Mijamind
quemingjian
负责人
协作者
+负责人
+协作者
标签
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (17)
标签 (29)
master
6.0.0
7.0.0-RC1
master_bak08271930
5.0.0
bugfix_0725
3.0.0
iud_dev
dev_board
5.1.0
kms
2.0.0
3.1.0
2.1.0
1.1.0
1.0.1
1.0.0
v6.0.2
v7.0.0-RC1
v6.0.1
v3.0.6
v6.0.0
v3.0.5B009
v5.0.3
v5.0.2
v6.0.0-RC1
v3.0.5
v5.0.1
v5.1.0
5.1.0
v5.0.0
v3.0.3
v3.1.1
v3.0.2
v3.1.0
v2.0.5
v3.0.1
v2.0.4
v2.0.3
v3.0.0
v2.1.0
v2.0.1
v2.0.0
v1.1.0
v1.0.1
v1.0.0
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(2)
C++
1
https://gitee.com/opengauss/openGauss-server.git
git@gitee.com:opengauss/openGauss-server.git
opengauss
openGauss-server
openGauss-server
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册