已关闭
[Bug]: Online DDL修改表的 append_mode 时不支持特殊表名的表 #8351
TonsnakeLin创建于  7月27日关闭于  8月24日
TonsnakeLin
TonsnakeLin
7月27日 创建

测试类型

SQL功能

测试版本

7.0.0-RC3

问题描述

执行 online ddl 时需要修改目标表的 append_mode 值,如下代码所示拼装 SQL 语句时没有使用双引号括起来,导致一些特殊名称的表对应的 alter 语句执行失败
bool OnlineDDLInstanceInit(Relation* relation, LOCKMODE lockmode, OnlineDDLType onlineDDLType, Oid partitionOid) { appendStringInfo(query, "ALTER TABLE %s.%s SET (append_mode = online_ddl)", get_namespace_name((*relation)->rd_rel->relnamespace), (*relation)->rd_rel->relname.data); }

操作系统和硬件信息

Linux linpin-PC 4.19.0-amd64-desktop #5444 SMP Wed Jun 24 15:22:46 CST 2026 x86_64 GNU/Linux

测试环境

企业版单机

被测功能

预置条件

操作步骤

  1. 预置条件
    CREATE TABLE "myTable" (id INT, val INT);
    INSERT INTO "myTable" SELECT i, i FROM generate_series(1, 10) i;

  2. 执行下面的命令时会报错,预期成功
    ALTER TABLE CONCURRENTLY "myTable" ALTER COLUMN val SET NOT NULL;

预期输出

执行成功

实际输出

执行报错

日志信息

无

提单组织

社区用户

测试代码

likedislike
opengauss_bot
opengauss_bot成员
7月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成员
7月27日 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
7月27日 添加了label:sig/StorageEngine,sig/AI,sig/CM,sig/CloudNative,sig/SecurityTechnology,sig/SQLEngine
opengauss_bot
opengauss_bot成员
7月27日 评论:

Welcome To openGauss Community

Hey @m0_58153217 , 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 .

likedislike
sungang14sungang14成员
8月3日 issue优先级由 无优先级 改变为 次要
sungang14sungang14成员
8月3日 关联了看板:openGauss 7.0.0-LTS
muyulinzhongmuyulinzhong成员
8月4日 将 luodongxu 设为负责人
muyulinzhongmuyulinzhong成员
8月4日 移除了负责人 TestManager
luodongxuluodongxu成员
8月8日 关联了pull request:fix(online-ddl): quote relation name when setting append_mode
luodongxuluodongxu成员
8月19日 issue状态由 待办的 改变为 待回归
luodongxu
luodongxu成员
8月19日 评论:

自验时间:2026/8/19
自验版本:B019
自验结果:通过
image.png

likedislike
lijing3007kkk
lijing3007kkk成员
8月24日 评论:

回归结论:通过
回归版本:7.0.0-LTS b0019
回归截图:

image.png

likedislike
lijing3007kkklijing3007kkk成员
8月24日 关闭了 issue
lijing3007kkklijing3007kkk成员
8月24日 issue状态由 待回归 改变为 已验收