Skip to content

OceanBase Oracle 克隆表结构时保留列、主键、普通索引与注释 - #11539

Closed
efeire wants to merge 24 commits into
t8y2:mainfrom
efeire:feat/11430-ob-table-clone
Closed

efeire wants to merge 24 commits into
t8y2:mainfrom
efeire:feat/11430-ob-table-clone

Conversation

@efeire

@efeire efeire commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #11430,依赖 #11483 和 #11391。OceanBase Oracle 表结构克隆从 CTAS 改为按元数据生成 DDL,保留支持的列属性、FLOAT 精度、主键、普通索引及注释,执行前明确复制/排除范围,失败报告已创建对象和人工恢复方式。

真实 GUI 暴露两个问题:虚拟列门禁读取不存在的 ALL_TAB_COLUMNS.VIRTUAL_COLUMN,普通表也无法预览;预览声明排除 UNIQUE 却复制其支撑索引,且遗漏外键排除名称。已改用实际 ALL_TAB_COLS,按可靠约束字典排除支撑索引、补外键名称;保留独立普通 UNIQUE INDEX,缺映射则拒绝,虚拟列仍不支持。

完整表元数据 → 明确复制/排除范围 → 逐条DDL → 独立字典与部分失败结果

Evidence

Before: 克隆普通表时,旧虚拟列查询读取不存在的字段而失败;声明排除 UNIQUE 却仍复制其支持索引。

After: 两文件接口回归 61 项通过。实际 OB 四入口克隆/结构粘贴、完整列/PK/索引/注释与排除范围独立比对一致,取消、冲突、权限、CREATE 丢响应及部分索引失败正确反馈;三 owner/自有服务清理。最新截断守卫仅有接口回归,未重造实库短行场景。Oracle 既有选项回归仍待,当前引擎拒绝 DESC/内嵌双引号不计通过。

回归与验收范围

已补齐本 PR 新增中文键缺失的目标语言文案;仓库 i18n-autofill 离线 dry-run 通过,已校验占位符和差异。

Merge Danger

Door: two-way(代码);已执行 DDL 需按实际状态单独恢复。

Blast Radius: 表结构克隆与结构粘贴。

DDL 逐条执行,未知或部分失败需核对残留后人工恢复。Oracle 既有克隆选项回归仍待;当前 OceanBase 拒绝 DESC 索引和内嵌双引号列名,这两项未计通过。

自动化状态与界面预览

自动预览只代表对应提交和沙盒场景,不能替代目标数据库的实库验收。

界面预览

当前提交的自动预览记录。以下沙盒截图/录屏展示相关界面,不能代替目标数据库验收;实际测试结果与未验范围见Evidence。

播放录屏
▶️ 点图打开录屏(可暂停、拖动)· 直接下载 mp4 · 红线是鼠标轨迹,红色圆环是点击

@efeire
efeire deployed to ui-preview October 9, 2026 16:08 — with GitHub Actions Active
@github-actions github-actions Bot added area/multiple Touches more than three repository areas db/oceanbase-oracle Database: OceanBase Oracle Mode db/postgres Database: PostgreSQL db/sqlserver Database: SQL Server ui-change Changes user-visible interface, text, or visual assets labels Oct 9, 2026
github-actions Bot added a commit that referenced this pull request Oct 9, 2026
@github-actions github-actions Bot removed db/postgres Database: PostgreSQL db/sqlserver Database: SQL Server labels Oct 9, 2026
@efeire efeire changed the title OceanBase Oracle 表结构克隆保留列、主键、普通索引与注释 OceanBase Oracle 克隆表结构时保留列、主键、普通索引与注释 Oct 9, 2026
@efeire
efeire deployed to ui-preview October 9, 2026 20:05 — with GitHub Actions Active
github-actions Bot added a commit that referenced this pull request Oct 9, 2026
@efeire
efeire deployed to ui-preview October 10, 2026 00:02 — with GitHub Actions Active
github-actions Bot added a commit that referenced this pull request Oct 10, 2026
@efeire
efeire marked this pull request as ready for review October 10, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/multiple Touches more than three repository areas db/oceanbase-oracle Database: OceanBase Oracle Mode ui-change Changes user-visible interface, text, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant