已关闭
[Bug]: alter table执行报错 #1621
ywzq1161327784创建于  27 天前关闭于  18 天前
ywzq1161327784
ywzq1161327784成员
27 天前 创建

测试类型

SQL功能

测试版本

7.0.0LTS

问题描述

alter table执行报错

操作系统和硬件信息

不限

测试环境

企业版单机

被测功能

alter table操作

预置条件

操作步骤

drop table t1 cascade;
create table t1(f1 int, f2 text, f3 int, f4 bigint, f5 int generated always as (f1 + f3) stored); 
insert into t1 values(1, 'aaa', 3, 1);
insert into t1 values(11, 'bbb', 33, 2);
insert into t1 values(111, 'ccc', 333, 3);
insert into t1 values(1111, 'ddd', 3333, 4);
select * from t1;

create view t1_view1 as select * from t1;
\d+ t1_view1;
select * from t1_view1;
alter table t1 drop f4;
alter table t1 add f8 int first, drop f2;
alter table t1 drop f5;
alter table t1 add f9 int after f1, drop f2;

预期输出

执行成功

实际输出

部分sql执行报错,删除f4之后后续add列报错
image.png

日志信息

见实际输出

提单组织

内部开发

测试代码

likedislike
ywzq1161327784ywzq1161327784成员
27 天前 添加了label:bug
opengauss_bot
opengauss_bot成员
27 天前 评论:

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成员
27 天前 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
27 天前 添加了label:sig/Plugin
opengauss_bot
opengauss_bot成员
27 天前 评论:

Welcome To openGauss Community

Hey @ywzq1161327784 , 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: Plugin ,
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: @dreamalloc, @huyinghao, @libiao2024, @wangfeihuo, @wmy_ld, @wuyuechuan, @xiong_xjun, @zhangxubo, @zhaojunv3z810 .

likedislike
ywzq1161327784ywzq1161327784成员
27 天前 关联了看板:openGauss 7.0.0-LTS
ywzq1161327784ywzq1161327784成员
27 天前 移除了负责人 TestManager
opengauss_bot
opengauss_bot成员
27 天前 评论:

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成员
27 天前 将 TestManager 设为负责人
ywzq1161327784ywzq1161327784成员
27 天前 将 ywzq1161327784 设为负责人,移除负责人 TestManager
ywzq1161327784ywzq1161327784成员
25 天前 issue状态由 待办的 改变为 已完成
ywzq1161327784
ywzq1161327784成员
23 天前 评论:

20260826自验ok

testb=# create table t1(f1 int, f2 text, f3 int, f4 bigint, f5 int generated always as (f1 + f3) stored);
CREATE TABLE
testb=# insert into t1 values(1, 'aaa', 3, 1);
INSERT 0 1
testb=# insert into t1 values(11, 'bbb', 33, 2);
INSERT 0 1
testb=# insert into t1 values(111, 'ccc', 333, 3);
INSERT 0 1
testb=# insert into t1 values(1111, 'ddd', 3333, 4);
INSERT 0 1
testb=# select * from t1;
  f1  | f2  |  f3  | f4 |  f5
------+-----+------+----+------
    1 | aaa |    3 |  1 |    4
   11 | bbb |   33 |  2 |   44
  111 | ccc |  333 |  3 |  444
 1111 | ddd | 3333 |  4 | 4444
(4 rows)

testb=#
testb=# create view t1_view1 as select * from t1;
CREATE VIEW
testb=# \d+ t1_view1;
                                  View "public.t1_view1"
 Column |  Type   |                   Modifiers                   | Stora
ge  | Description
--------+---------+-----------------------------------------------+------
----+-------------
 f1     | integer |                                               | plain
    |
 f2     | text    | character set UTF8 collate utf8mb4_general_ci | exten
ded |
 f3     | integer |                                               | plain
    |
 f4     | bigint  |                                               | plain
    |
 f5     | integer |                                               | plain
    |
View definition:
 SELECT  *
   FROM t1;

testb=# select * from t1_view1;
  f1  | f2  |  f3  | f4 |  f5
------+-----+------+----+------
    1 | aaa |    3 |  1 |    4
   11 | bbb |   33 |  2 |   44
  111 | ccc |  333 |  3 |  444
 1111 | ddd | 3333 |  4 | 4444
(4 rows)

testb=# alter table t1 drop f4;
ALTER TABLE
testb=# alter table t1 add f8 int first, drop f2;
ALTER TABLE
testb=# alter table t1 drop f5;
ALTER TABLE
testb=# alter table t1 add f9 int after f1, drop f2;
ERROR:  column "f2" of relation "t1" does not exist
likedislike
ywzq1161327784ywzq1161327784成员
23 天前 issue状态由 已完成 改变为 待回归
yangl_
yangl_成员
20 天前 评论:

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

likedislike
liuzhen001liuzhen001成员
18 天前 issue状态由 待回归 改变为 已验收
liuzhen001liuzhen001成员
18 天前 关闭了 issue