已关闭
[Bug]: ogsql 多行 continuation 下 FROM/WHERE Tab 补全失效 #297
wuchenlong创建于  7月27日关闭于  8月27日
wuchenlong
wuchenlong成员
7月27日 创建

测试类型

工具功能

测试版本

7.0.0-RC3

操作系统和硬件信息

openEuler 20.03 aarch64

测试环境

资源池化

被测功能

ogsql Tab — 多行 continuation 提示符下补全上下文丢失

预置条件

oGRAC ONLINE;ogsql / as sysdba TTY;已建 test1(id, name)。需求文档:多行 g_sql_text 聚合后应按完整语句解析 FROM/WHERE 语境。

操作步骤

# 场景 9:多行 SELECT,在 continuation 第 4 行 FROM 后 Tab
SQL> select
  2 *
  3 from
  4 <Tab>          -- 期望补 test1 等表名

# 场景 10:多行 SELECT + WHERE,在第 5 行 where 后 Tab
SQL> select
     *
     from
     test1
     where
  2 name<Tab>      -- 期望补 name 等列
  3 is null;

# 对照:单行 `select * from test1 where na` + Tab 可补列(若可)

预期输出

多行输入与单行等价:FROM 后补表名;WHERE 后补当前 FROM 表列名。
continuation 行号不影响补全上下文解析。

实际输出

场景 9:第 4 行空行按 Tab → 无表名候选(PTY 自动化复核 2026-07-27)
场景 10:多行 where 之后列前缀 → 用户实测不补列名

单行同语句 Tab 补全正常 → 多行聚合/解析路径未带入补全模块。

日志信息

用户手工 #9/#10。需求见 ogsql_readline需求文档 g_sql_text、多行状态机。

提单组织

测试团队

likedislike
wuchenlongwuchenlong成员
7月27日 添加了label:bug
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
opengauss_bot
opengauss_bot成员
7月27日 评论:

Welcome To openGauss Community

Hey @wuchenlong , 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 ,
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: @CityYard, @libiao2024, @lijieac, @theothersideofsea, @wang_bowen, @weithu, @xiong_xjun, @yuanyazhi, @zhangzq131 .

likedislike
wuchenlongwuchenlong成员
7月27日 关联了看板:临时看板
chendong76chendong76成员
8月3日 关联了看板:openGauss 7.0.0-LTS
chendong76chendong76成员
8月3日 移除了看板:临时看板
wuchenlongwuchenlong成员
8月3日 issue优先级由 无优先级 改变为 主要
muyulinzhongmuyulinzhong成员
8月4日 将 leweiyang 设为负责人
muyulinzhongmuyulinzhong成员
8月4日 移除了负责人 TestManager
leweiyang
leweiyang成员
8月21日 评论:

image.png

已修复,多行输入后按Tab键可进行补全

-- 清理旧对象
DROP TABLE IF EXISTS test1 CASCADE;
DROP TABLE IF EXISTS test2 CASCADE;

-- 创建主测表 test1
CREATE TABLE test1 (
id INT PRIMARY KEY,
name VARCHAR(50)
);

-- 创建辅助表 test2(用于验证 FROM 后表名候选是否完整)
CREATE TABLE test2 (
id INT PRIMARY KEY,
value VARCHAR(50)
);

-- 插入数据(可选)
INSERT INTO test1 VALUES (1, 'Alice');
INSERT INTO test1 VALUES (2, 'Bob');
INSERT INTO test2 VALUES (1, 'X');
COMMIT;

SQL> select
2 *
3 from
4 <这里按一次 Tab>
image.png

SQL> select
*
from
test1
where
2 na<按Tab>
3 is null;
image.png

对于截断问题在文档中进行了介绍

image.png

likedislike
leweiyangleweiyang成员
8月21日 关联了pull request:稳定 readline 粘贴、连续输入与多行编辑状态(#294、#297、#300)
leweiyangleweiyang成员
8月26日 issue状态由 待办的 改变为 待回归
wuchenlong
wuchenlong成员
8月27日 评论:

回归版本:oGRAC Release 7.0.0-RC3 18ce0a2 build 2026-08-26 09:48:01
回归环境:oGRAC 双节点(20.20.20.104 / 20.20.20.106),db=ONLINE,节点 20.20.20.104 执行
结论:通过(多行 continuation 下 FROM/WHERE 补全上下文未丢失)

回归步骤(ogsql / as sysdba,Linux TTY)

SQL> select
  2 *
  3 from
  4 te<Tab>                 -- 补为 test1
SQL> select
  2 *
  3 from test1
  4 where na<Tab>           -- 补为 name

实际输出
te → test1;where na → where name。
说明:FROM 后空前缀 Tab 仍会列出系统视图(32 条截断),带前缀即可命中业务表,原「continuation 丢语境」已修复。

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