Skip to content

Query with SP doesn't accept explicit plan [CORE3451] #3812

@firebird-automations

Description

@firebird-automations

Submitted by: @pcisar

Relate to CORE3450
Is duplicated by CORE2629

Test query for CORE3450 doesn't accept explicit execution plan.

select t2.fld1
from tmp_tbl2 t2
join tmp_tbl1 t1 on t1.fld1=t2.fld1
join tmp_sp1 on tmp_sp1.fld1=t1.fld2
join tmp_tbl3 t3 on t3.fld1=t1.fld3
where t2.fld2=2
PLAN JOIN (JOIN (TMP_SP1 NATURAL, T1 INDEX (TMP_TBL1_FLD2)), T2 INDEX (TMP_TBL2_FLD1), T3 INDEX (TMP_TBL3_FLD1))
;
return error:
Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Invalid command
there is no alias or table named TMP_SP1 at this scope level

The explicit plan is exactly the one returned for the query.