环境:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
“CORE 11.2.0.1.0 Production”
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
刚准备测试一下半连接的返回值情况,结果来了个bug
触发bug的sql如下:
drop table ysy_tab1;
create table ysy_tab1
as
select dbms_random.string('u', 1) tname, rownum rn
from dual
connect by rownum < 1000;
drop table ysy_tab2;
create table ysy_tab2
as
select dbms_random.string('u', 1) tname, rownum rn
from dual
connect by rownum < 1000;
--触发bug的sql
select /*+ use_nl(a,tt@yy)*/ * from ysy_tab1 a where a.tname not in (select /*+ qb_name(yy)*/ tname from ysy_tab2 tt );
无论是执行还是查看执行计划,报如下错误:
经测试时,如果把use_nl改成use_aj , 就不报错,所以这个报错跟 hint有关
放在sqlplsu里面执行也一样:
有兴趣的可以按照上面的做一下,看能不能重现;