firebird
firebird copied to clipboard
ISQL does not show 'CONSTANT' for some / all non-aliased columns if UNION presents in the query
Consdier following script:
--set list on;
set echo on;
-- q1
select '12345', '', ''
from rdb$database
;
------------------------------------------
-- q2
select '12345', '', ''
from rdb$database
union all
select
'12345',
'y' as y,
'z' as z
from rdb$database
;
------------------------------------------
-- q3
select
'12345', '', ''
from rdb$database
union all
select
'123456',
'y' as y,
'z' as z
from rdb$database
;
Its output will be:
-- q1:
CONSTANT CONSTANT CONSTANT
======== ======== ========
12345
-- q2:
CONSTANT
======== ====== ======
12345
12345 y z
-- q3:
====== ====== ======
12345
123456 y z
Not let's uncomment set list on; and repeat.
Output will be:
-- q1:
CONSTANT 12345
CONSTANT
CONSTANT
--q2:
CONSTANT 12345
CONSTANT 12345
y
z
-- q3:
12345
123456
y
z
PS. Result is the same on 3.x ... 6.x, i.e. this is not regression.
It's not ISQL that decides on that name, but the server.