问题现象
使用 leading hint 调整 SQL 执行计划后,执行 SQL 时,报错:YAS-04522 invalid hint leading
问题的风险及影响
SQL 语句无法正常执行
问题影响的版本
所有的 YashanDB 版本
问题发生原因
YashanDB 优化器的 Bug
解决方法及规避方式
规避方式:不使用 leading hint
问题分析和处理过程
使用如下 SQL 语句验证当前版本 YashanDB 是否存在此问题:
drop table a;
drop table b;
drop table c;
create table a(tid number,tname varchar2(30));
create table b(tid number,tname varchar2(30));
create table c(tid number,tname varchar2(30));
select /*+ leading(c) */ distinct a.tid
from a
left join b
on a.tid = b.tid
left join c
on b.tid = c.tid
where a.tname is not null;
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。