已关闭
[Bug]: 序列的起始值和最小值设定为不同值时,truncate restart后序列未从起始值重新开始 #8466
songfei创建于  18 天前关闭于  10 天前
songfei
songfei成员
18 天前 创建

测试类型

SQL功能

测试版本

7.0.0LTS

问题描述

序列的起始值和最小值设定为不同值时,truncate restart后序列未从起始值重新开始

操作系统和硬件信息

Kylin Linux Advanced Server release V10 (Sword)

Linux localhost 4.19.90-24.4.v2101.ky10.aarch64

测试环境

企业版单机

被测功能

SQL功能

预置条件

兼容PG库

操作步骤

`DROP TABLE IF EXISTS r1_t CASCADE;
DROP SEQUENCE IF EXISTS r1_s;
CREATE SEQUENCE r1_s START WITH 100;
CREATE TABLE r1_t(id int DEFAULT nextval('r1_s'), c text);
ALTER SEQUENCE r1_s OWNED BY r1_t.id;

INSERT INTO r1_t(c) VALUES('a'),('b');
SELECT * FROM r1_t;
TRUNCATE r1_t RESTART IDENTITY;
INSERT INTO r1_t(c) VALUES('c');
SELECT * FROM r1_t;`

预期输出

SELECT * FROM r1_t;
id | c
----+---
100 | c
(1 row)

实际输出

SELECT * FROM r1_t;
id | c
----+---
1 | c
(1 row)

日志信息

image.png

提单组织

联合伙伴

测试代码

likedislike
songfeisongfei成员
18 天前 添加了label:bug
songfeisongfei成员
18 天前 关联了看板:openGauss 7.0.0-LTS
opengauss_bot
opengauss_bot成员
18 天前 评论:

Welcome To openGauss Community

Hey @songfei_sz , 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. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

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, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zhangzq131, @zjh_hw .

likedislike
opengauss_botopengauss_bot成员
18 天前 添加了label:sig/SQLEngine
yelingzhiyelingzhi成员
17 天前 关联了pull request:修复执行truncate restart identity时,序列未从起始值重新开始的问题
yelingzhiyelingzhi成员
13 天前 关联了pull request:修复truncate restart序列未从起始值重新开始的问题
ywzq1161327784ywzq1161327784成员
12 天前 issue状态由 待办的 改变为 待回归
songfeisongfei成员
10 天前 issue状态由 待回归 改变为 已验收
songfeisongfei成员
10 天前 关闭了 issue
songfei
songfei成员
10 天前 评论:

7.0.0LTSb021版本中已修复

likedislike