OpenTenBase / OpenTenBase/TXSQL
Bug: Fix sort_merge_join hint crash when used at query block level
还没有人认领这个 Issue。
- 主要语言
- C++
- 星标
- 338
- 派生
- 235
- PR 合并指标
- 30 天内没有已合并 PR
描述
Description:
SORT_MERGE_JOIN hint was incorrectly registered as a non-QB-level,
non-switch hint (false, false in opt_hint_info), and was also
incorrectly treated as a compound hint in is_compound_hint() and
get_complex_hints(). When SORT_MERGE_JOIN was used at query block
level (e.g., /+sort_merge_join()/), calling get_complex_hints()
would crash because the hint type was routed to the compound hint
path (via Opt_hints_table::get_compound_key_hint()), which
returned an invalid pointer for SORT_MERGE_JOIN_HINT_ENUM.
How to repeat:
create table t1 (c int, b int);
create table t2 (a int, b int);
create table t3 (b int, c int);
insert into t1 values (10,1);
insert into t1 values (3 ,1);
insert into t1 values (3 ,2);
insert into t2 values (2, 1);
insert into t2 values (3, 1);
insert into t3 values (1, 3);
insert into t3 values (1,10);
ANALYZE TABLE t1, t2, t3;
select /*+sort_merge_join()*/ *
from t1
inner join t2 on t1.b=t2.b
inner join t3 on t3.c = t1.c and t3.b = t2.b;
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 SORT_MERGE_JOIN_HINT_ENUM 的 is_compound_hint()、get_complex_hints() 和 Opt_hints_table::get_compound_key_hint(),然后检查其 opt_hint_info 注册。重新运行提供的 query block 级别 SORT_MERGE_JOIN 示例查询;当 get_complex_hints() 不再崩溃,并且该 hint 按预期的 query block 和 compound-hint 行为进行分类时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp, sql
- 领域
- databases
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100