OpenTenBase / OpenTenBase/TXSQL

subquery_to_derived duplicate name

未关闭
#69 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
337
派生
234
PR 合并指标
30 天内没有已合并 PR

描述

With optimizer_switch='subquery_to_derived=on', running the reproducer below on a freshly created schema crashes the server process. The query was expected to return a result set (or at worst a query-level error) without affecting the server, but instead the server crashes. With subquery_to_derived=off the same query runs fine.

Crash SQL

CREATE TABLE t1 (a BIGINT PRIMARY KEY, b BIGINT);
CREATE TABLE t2 (a BIGINT PRIMARY KEY);

SELECT /*+ SET_VAR(optimizer_switch='subquery_to_derived=on') */
       COUNT(DISTINCT s.a) = (SELECT COUNT(DISTINCT s1.a)
                              FROM t2 s1 WHERE s1.a = o.b) AS x
FROM t1 o LEFT JOIN t2 s ON o.b = s.a
GROUP BY o.a, o.b;

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在启用 subquery_to_derived 的全新创建的 schema 上运行提供的 SQL 复现程序,然后将其与禁用该设置的情况进行比较。跟踪转换子查询并处理重复名称的优化器路径;完成的标准是查询不再导致服务器崩溃,而是返回结果集或查询级错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
sql
领域
databases
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。