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


Welcome To openGauss Community
Hey @liyangx , 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, @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 .


【回归人员】sungang14
【回归日期】20260824
【回归版本】openGauss7.0.0master
【回归结论】通过
【回归步骤】
shark 用例中identity用例执行通过
shark 用例中pg_identity_dump_restore用例执行通过



测试类型
SQL功能
测试版本
7.0.0LTS
问题描述
① shark 用例执行结果与预期不符:identity用例(修复后请放开 contrib/shark/parallel_schedule 中 identity 用例 )
shark 的 identity 回归用例执行失败。用例中多处 D 兼容 identity 相关 SQL 与预期不一致,主要表现为
CREATE TABLE ... LIKE ... INCLUDING IDENTITY在复制 D identity 列时失败,报错Identity column contains invalid INCREMENT.。失败后目标表未创建成功,导致后续
\d+、insert、select、drop 等语句继续报 relation does not exist,形成连锁错误。该问题不是 dump/restore 问题,也不是简单 expected 更新问题。失败发生在 identity 用例普通 SQL 执行阶段,属于 D identity 在
LIKE ... INCLUDING IDENTITY场景下复制 identity 属性/序列参数失败的问题。相关提交PR:
https://gitcode.com/opengauss/openGauss-server/pull/9137
② shark 用例执行结果与预期不符:pg_identity_dump_restore用例
该用例由PR https://gitcode.com/opengauss/openGauss-server/pull/9137 新建,麻烦分析解决相关问题,
且用例存在dump问题,可同 issue https://gitcode.com/opengauss/openGauss-server/issues/8401 同步推进
如下描述为 identity用例 diffs 分析,仅做参考。
修复测试时请查看shark模块下 parallel_schedule 是否正常打开相关用例
操作系统和硬件信息
不限
测试环境
企业版单机
被测功能
shark用例
预置条件
操作步骤
执行 shark 的 identity 回归用例:
cd shark目录 make check p=38000或在 shark 回归测试中单独执行 identity 用例。
用例中触发失败的典型 SQL 包括:
create table t_identity_numeric_t4(id numeric(38, 0) identity, name varchar(10)); create table t_identity_numeric_t4_1 (like t_identity_numeric_t4 including identity); create table t_identity_numeric_t5(id numeric(38, 0) identity(987654321098765432100000, 2), id1 serial, name varchar(10)); create table t_identity_numeric_t5_1 (like t_identity_numeric_t5 including identity); create table t_identity_numeric_t6(id numeric(38, 0) identity(2, 987654321098765432100000), id1 serial, name varchar(10)); create table t_identity_numeric_t6_1 (like t_identity_numeric_t6 including identity); create sequence identity_t2_id_seq_identity; create table identity_t2(id numeric(38, 0) identity(10, 2), b int); create table identity_t2_1 (like identity_t2 including identity);预期输出
identity 用例应执行通过。
CREATE TABLE ... LIKE ... INCLUDING IDENTITY 应成功复制原表 D identity 属性,新表创建成功,后续 \d+、insert、select、drop 等语句正常执行。
例如:
后续插入和查询结果符合 expected 输出。
实际输出
identity 用例执行失败,CREATE TABLE ... LIKE ... INCLUDING IDENTITY 报错:
随后因为目标表未创建成功,后续语句继续失败:
日志信息
①identity用例执行diffs:
② pg_identity_dump_restore 用例执行diffs
====================================================================== *** /home/tester2/sda/openGauss-server-ob-ai/contrib/shark/expected/pg_identity_dump_restore.out.smartmatch 2026-08-14 15:49:23.691307965 +0800 --- /home/tester2/sda/openGauss-server-ob-ai/contrib/shark/results/pg_identity_dump_restore.out 2026-08-14 15:49:21.947287941 +0800 *************** *** 43,50 **** SET CREATE TABLE ALTER TABLE ! ALTER TABLE ! ALTER SEQUENCE CREATE TABLE ALTER TABLE ALTER TABLE --- 43,52 ---- SET CREATE TABLE ALTER TABLE ! gsql:/home/tester2/sda/openGauss-server-ob-ai/contrib/shark/tmp_check/install/home/tester2/sda/openGauss-server-ob-ai/mppdb_temp_install/bin/s_test_pg_identity_dump_restore.sql:72: ERROR: syntax error at or near "CACHE" ! LINE 2: CACHE 1 ! ^ ! gsql:/home/tester2/sda/openGauss-server-ob-ai/contrib/shark/tmp_check/install/home/tester2/sda/openGauss-server-ob-ai/mppdb_temp_install/bin/s_test_pg_identity_dump_restore.sql:79: ERROR: relation "book_bookid_seq_identity" does not exist CREATE TABLE ALTER TABLE ALTER TABLE *************** *** 52,62 **** ALTER TABLE ALTER TABLE ALTER TABLE ! setval ! -------- ! 4 ! (1 row) ! setval -------- 22 --- 54,63 ---- ALTER TABLE ALTER TABLE ALTER TABLE ! gsql:/home/tester2/sda/openGauss-server-ob-ai/contrib/shark/tmp_check/install/home/tester2/sda/openGauss-server-ob-ai/mppdb_temp_install/bin/s_test_pg_identity_dump_restore.sql:170: ERROR: relation "book_bookid_seq_identity" does not exist ! LINE 1: SELECT pg_catalog.setval('book_bookid_seq_identity', 4, true... ! ^ ! CONTEXT: referenced column: setval setval -------- 22 *************** *** 72,78 **** 102 (1 row) ! \c s_test_pg_identity_dump_restore_1 set current_schema = s_test_pg_identity_dump_restore; \d+ test_t1 --- 73,79 ---- 102 (1 row) ! total time: 265 ms \c s_test_pg_identity_dump_restore_1 set current_schema = s_test_pg_identity_dump_restore; \d+ test_t1 *************** *** 102,108 **** Table "s_test_pg_identity_dump_restore.book" Column | Type | Modifiers | Storage | Stats target | Description ----------+---------------+-----------------------------------------------+----------+--------------+------------- ! bookid | integer | not null identity | plain | | bookname | nvarchar2(50) | character set UTF8 collate utf8mb4_general_ci | extended | | author | nvarchar2(50) | character set UTF8 collate utf8mb4_general_ci | extended | | Has OIDs: no --- 103,109 ---- Table "s_test_pg_identity_dump_restore.book" Column | Type | Modifiers | Storage | Stats target | Description ----------+---------------+-----------------------------------------------+----------+--------------+------------- ! bookid | integer | not null | plain | | bookname | nvarchar2(50) | character set UTF8 collate utf8mb4_general_ci | extended | | author | nvarchar2(50) | character set UTF8 collate utf8mb4_general_ci | extended | | Has OIDs: no *************** *** 118,124 **** --- 119,131 ---- INSERT INTO test_t2 DEFAULT VALUES; INSERT INTO test_t2 DEFAULT VALUES; INSERT INTO book VALUES('book1','author1'),('book2','author2'); + ERROR: invalid input syntax for integer: "book1" + LINE 1: INSERT INTO book VALUES('book1','author1'),('book2','author2... + ^ + CONTEXT: referenced column: bookid INSERT INTO book(bookname,author) VALUES('book3','author3'),('book4','author4'); + ERROR: null value in column "bookid" violates not-null constraint + DETAIL: Failing row contains (null, book3, author3). select * from test_t1 order by 1, 2; a | b ----+--- *************** *** 134,147 **** (2 rows) select * from book order by 1, 2; ! bookid | bookname | author ! --------+----------+--------- ! 1 | book1 | author1 ! 2 | book2 | author2 ! 3 | book3 | author3 ! 4 | book4 | author4 ! (4 rows) \c postgres drop database s_test_pg_identity_dump_restore; ! drop database s_test_pg_identity_dump_restore_1; \ No newline at end of file --- 141,150 ---- (2 rows) select * from book order by 1, 2; ! bookid | bookname | author ! --------+----------+-------- ! (0 rows) \c postgres drop database s_test_pg_identity_dump_restore; ! drop database s_test_pg_identity_dump_restore_1; ======================================================================提单组织
内部开发
测试代码
shark 用例: identity、pg_identity_dump_restore