You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Column unknown" error while preparing a recursive query if the recursive part contains ALIASED datasource in the join with anchor table [CORE4694]
#5002
recreate table xcall_stack (
xcall_id int
,xcaller_id int
);
commit;
set planonly;
with recursive
r as (
select c.xcall_id
from xcall_stack c
where c.xcaller_id is null
UNION ALL
select
c\.xcall\_id
from xcall\_stack c
join r
AS h \-\- <<<<<<<<<<<<<<<<<<<<<< ::: NB ::: \`r\` is aliased
on c\.xcaller\_id = h\.xcall\_id
)
select r.xcall_id
from r;
Test on 2.5 (passed OK):
ISQL Version: WI-V2.5.4.26838 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-V2.5.4.26838 Firebird 2.5"
Firebird/x86/Windows NT (remote server), version "WI-V2.5.4.26838 Firebird 2.5/tcp (csprog)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.4.26838 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2
PLAN (R C NATURAL)
PLAN (R C NATURAL)
Test on 3.0:
ISQL Version: WI-T3.0.0.31655 Firebird 3.0 Beta 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2/tcp (csprog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2/tcp (csprog)/P13"
on disk structure version 12.0
Statement failed, SQLSTATE = 42S22
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-H.XCALL_ID
-At line 17, column 6
At line 26 in file rec-broken.sql
PS. No error message if recursive part looks like this:
. . .
UNION ALL
select c\.xcall\_id
from xcall\_stack c
join r \-\- <<<<<<<<<<<<<<<<<<<<<<<<<<< NO alias here for \`r\`
on c\.xcaller\_id = r\.xcall\_id
summary: Can`t prepare recursive query if recursive part contains ALIASED datasource in the join with anchor table => "Column unknown" error while preparing a recursive query if the recursive part contains ALIASED datasource in the join with anchor table
Submitted by: @pavel-zotov
DDL:
show version;
recreate table xcall_stack (
xcall_id int
,xcaller_id int
);
commit;
set planonly;
with recursive
r as (
select c.xcall_id
from xcall_stack c
where c.xcaller_id is null
)
select r.xcall_id
from r;
Test on 2.5 (passed OK):
ISQL Version: WI-V2.5.4.26838 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-V2.5.4.26838 Firebird 2.5"
Firebird/x86/Windows NT (remote server), version "WI-V2.5.4.26838 Firebird 2.5/tcp (csprog)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.4.26838 Firebird 2.5/tcp (csprog)/P12"
on disk structure version 11.2
PLAN (R C NATURAL)
PLAN (R C NATURAL)
Test on 3.0:
ISQL Version: WI-T3.0.0.31655 Firebird 3.0 Beta 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2/tcp (csprog)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31655 Firebird 3.0 Beta 2/tcp (csprog)/P13"
on disk structure version 12.0
Statement failed, SQLSTATE = 42S22
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-H.XCALL_ID
-At line 17, column 6
At line 26 in file rec-broken.sql
PS. No error message if recursive part looks like this:
. . .
UNION ALL
. . .
Commits: 3ff5513 FirebirdSQL/fbt-repository@273af87
====== Test Details ======
Fixed on 3.0 since rev 60747, 2015-02-20 16:56
The text was updated successfully, but these errors were encountered: