You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split follow-up from #31448: unresolved issue components #32437
The selector classified that parent issue as partially fixed because:
PR #29472, commit c2c1031, adds functional-index support with both lower and upper in functionalExpressionEligible. pkg/sql/plan/functional_index_test.go:TestFunctionalIndexOwnershipAfterDropColumn builds an index containing UPPER(name). The same commit supplies docs/design/20260929-functional-index-initial-support.md, which explicitly lists the supported expression boundary. Both code and documentation remain in origin/main@bf086489bae357159b53f8bcdfc04082ca55b210.
Remaining unresolved subproblems:
Ordinary scalar functional indexes still reject SUBSTRING, LEFT, MD5, CRC32, HEX, REVERSE, LENGTH, and CONCAT over otherwise eligible columns; investigate safe admission with focused DDL and index-versus-scan proof.
The consolidated expression CAST(JSON_EXTRACT(j, constant_path) AS INT) remains rejected by the eligibility gate; preserve it as a separate numeric JSON functional-index case.
Unsupported deterministic expressions still receive 'functional index expression must have session-independent semantics'; distinguish unsupported expression coverage from actual session dependence and document the resulting supported boundary.
SUBSTRING、LEFT、MD5、CRC32、HEX、REVERSE、LENGTH、CONCAT 及 numeric JSON CAST 的函数索引可以按支持边界建立和查询;不支持的确定性表达式返回明确的 functional index expression is not supported,与会话依赖/非确定性诊断区分。
Activity
gouhongshen commentedon Nov 11, 2026
PR #32510 is trying to fix this issue.
feat(plan): widen functional index expression eligibility and diagnos…
gouhongshen commentedon Nov 11, 2026
PR #32510 has merged and is awaiting manual validation. The issue remains open.
XuPeng-SH commentedon Nov 11, 2026
QA 交接:PR #32510 已合入 main,merge SHA
7376adec177d075d4469ad3442cb704d2650d492(head043831fc9861653b454133145821e7bb9fbb9dbc),覆盖本单三个拆分项:指定 scalar functional index 准入、numeric JSON CAST 索引,以及不支持/会话依赖/非确定性诊断区分,并补齐表达式持久化和重命名回放。本轮仅核对远端范围和完整 issue 评论,未本地实测,不代表验收通过。作者报告旧基线及评审反例红转绿;最终 plan/tree 全包通过,三个 sqlintegration 生命周期测试通过,vet/lint 通过,重建服务后 BVT 连续两轮各 271/271。PR 记载旧评审的 signed literal、prepared numeric provenance、integer→DECIMAL comparison 三项已修复;这些是作者报告,不冒称本轮或所有 CI 通过。
交由 @Ariznawlll 验证:八类 scalar 与 numeric JSON 各整数类型/溢出/NULL;FORCE/IGNORE 索引结果一致及真实命中;insert/update/rollback;SHOW CREATE、LIKE/COPY、rename 的 key 类型和值域保真;诊断文本及拒绝 DDL 无元数据变化。重点复核负字面量、普通 prepared 数字/DECIMAL 比较和反斜杠字面量。
left(name,-1)residual-only、显式 CAST 不匹配,以及未列入函数仍拒绝是声明边界;旧持久化文本不迁移,旧版本不可据此回放新增类别。部署环境/多 CN/升级场景尚未由本轮验证。当前完整评论没有适用反例或未完成开发 follow-up,转 QA 并保持开放。Ariznawlll commentedon Nov 12, 2026
测试版本
main@4760bcaa88b23fabe064b1631b624c0e8c40d549,包含修复 #32510。隔离 CI 为 1 LogService / 1 TN / 2 CN,两个 CN 的git_version()与完整 SHA 一致。main@c8accd138bb91144050ff173100afd7a71a02888;本次不表述为 4.2-dev 验收。原问题验证
SUBSTRING、LEFT、MD5、CRC32、HEX、REVERSE、LENGTH、CONCAT 及 numeric JSON CAST 的函数索引可以按支持边界建立和查询;不支持的确定性表达式返回明确的
functional index expression is not supported,与会话依赖/非确定性诊断区分。Happy Path
两个 CN 各 3 轮运行主库
functional_index与functional_json_key完整标准 BVT,每轮 271/271,包含 FORCE/IGNORE 对照、NULL、insert/update/rollback、LIKE/COPY、重命名、负字面量和反斜杠持久化。补充 8 类 scalar 表达式的执行计划,48/48 确认出现相应索引扫描。文本及二进制 prepared 数值 JSON 查询覆盖普通整数、超 32 位整数、DECIMAL、非整数与 NULL,双 CN 各 3 轮 66/66 与预期一致。
Unhappy Path
覆盖不支持函数、错误参数数量和类型、整数边界及溢出拒绝;SHA1 负例返回 20105,拒绝 DDL 前后
SHOW CREATE TABLE不变,随后合法操作及连接可用。白盒验证
核对表达式 eligibility、数值 JSON CAST 和表达式序列化/重放边界;保留负长度 LEFT 的 residual-only、显式 CAST 不匹配及未列入函数仍拒绝的既有约束,不宣称旧版本可回放新类别。
回归测试
已有主库两份 BVT 使用官方 tester 保留 JDBC 元数据比较;数值 JSON 索引 prepared 回归已加入 MOTR PR #329,尚待合入。
测试证据
最新 main 双 CN CI run 43160131712 中,两个 CN 各 3 轮标准 BVT 每轮 271/271、0 跳过,并执行 MOTR prepared 回归,run 整体成功。本次未声称旧版本升级回放或未列入函数通过。
测试结论
测试通过。本单列出的函数准入、numeric JSON 索引和诊断边界在已验证范围内符合预期。