已关闭
[Bug]: ogsql 字面制表符误触发 Tab 补全 #294
wuchenlong创建于  7月27日关闭于  27 天前
wuchenlong
wuchenlong成员
7月27日 创建

测试类型

工具功能

测试版本

7.0.0-LTS

操作系统和硬件信息

openEuler 20.03 aarch64

测试环境

oGRAC双节点

被测功能

ogsql Readline — 输入缓冲中的制表符字面量不应触发 Tab 补全

预置条件

oGRAC 双节点 ONLINE;ogsql / as sysdba 真实 TTY;HISTORY ON。

操作步骤

# 场景 A:从外部复制含制表符(Tab 字符)的 SQL 粘贴到 SQL> 行
select * from		sys_tables where id=1;
# 观察:粘贴后是否弹出补全候选/改写光标处 token(不应)

# 场景 B:管道输入含制表符(非交互,对照)
printf 'SHOW HISTORY;\nSELECT\t 1;\n' | ogsql / as sysdba -q

# 场景 C:行内已有制表符后再按 Tab 键尝试补全
# 在 from 与表名之间插入字面 Tab 后,移动光标再按 Tab

设计依据:EQ-GSQL-PASTE-TAB / gsql 对照「粘贴含制表符片段」— 缓冲与显示应不乱,不应把字面 Tab 当补全触发

预期输出

字面制表符仅作为空白/分隔符写入编辑缓冲,不触发 readline 补全逻辑;
粘贴含 Tab 的 SQL 后行内容保持原样,无候选列表弹出。

实际输出

手工复现(2026-07-27):从外部复制
  select * from\t\tsys_tables where id=1;
粘贴到 SQL> 后触发补全行为(不应发生)。

对照:正常空格分隔的同一语句不触发;问题与缓冲内 \t 字符被误当作补全按键/触发词相关。

日志信息

用户手工测试项 #1。PTY 自动化待补场景 JSON。与列补全噪声 #288/#290 无关。

提单组织

测试团队

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日 修改了issue 的描述
sungang14sungang14成员
8月3日 issue优先级由 无优先级 改变为 次要
sungang14sungang14成员
8月3日 关联了看板:openGauss 7.0.0-LTS
muyulinzhongmuyulinzhong成员
8月4日 将 leweiyang 设为负责人
muyulinzhongmuyulinzhong成员
8月4日 移除了负责人 TestManager
leweiyang
leweiyang成员
8月21日 评论:

image.png

已修复,黏贴含tab的文本时不会触发补全
image.png

通过管道输入含 \t 的 SQL,观察非交互模式下是否异常
printf 'SHOW HISTORY;\nSELECT\t 1;\n' | ogsql / as sysdba -q
printf 'SHOW HISTORY;\nSEL\t 1;\n' | ogsql / as sysdba -q

image.png
image.png

likedislike
leweiyangleweiyang成员
8月21日 关联了pull request:稳定 readline 粘贴、连续输入与多行编辑状态(#294、#297、#300)
leweiyangleweiyang成员
28 天前 issue状态由 待办的 改变为 待回归
wuchenlong
wuchenlong成员
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 执行
结论:通过(粘贴含制表符的 SQL 不再误触发 Tab 补全)

回归步骤ogsql / as sysdba,Linux 真实 TTY,手工粘贴)

从外部复制含字面 Tab 的语句后粘贴到 SQL>,例如:
select * from\t\tsys_tables where id=1;

实际输出
手工验证:粘贴后行内容保持原样,无候选列表弹出、无改写。符合「字面制表符仅作空白、不触发补全」。

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