NOT-null field from derived table became NULL when is referred outside DT
-------------------------------------------------------------------------

                 Key: CORE-4289
                 URL: http://tracker.firebirdsql.org/browse/CORE-4289
             Project: Firebird Core
          Issue Type: Bug
    Affects Versions: 3.0 Alpha 1
            Reporter: Pavel Zotov


It seems that last build has a bug when query contains derived table:

Script:

show version;
select q.n, case when q.n=0 then 'zero' when q.n<>0 then 'NON-zero' else 
'Hm!..' end what_is_n
from (select 0 N from RDB$DATABASE) q;

result in revision 58891:
===================
ISQL Version: WI-V2.5.3.26661 Firebird 2.5
Server version:
Firebird/linux AMD64 (access method), version "LI-T3.0.0.30780 Firebird 3.0 
Alpha 1"
Firebird/linux AMD64 (remote server), version "LI-T3.0.0.30780 Firebird 3.0 
Alpha 1/tcp (oel64)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.3.26661 Firebird 
2.5/tcp (csprog)/P12"
on disk structure version 12.0
SQL> select q.n, case when q.n=0 then 'zero' when q.n<>0 then 'NON-zero' else 
'Hm!..' end what_is_n
CON> from (select 0 N from RDB$DATABASE) q;

           N WHAT_IS_N
============ =========
           0 Hm!.. -- that seems strange... ;-)



result in some of previous versions:
============================
ISQL Version: WI-V2.5.3.26661 Firebird 2.5
Server version:
Firebird/x86/Windows NT (access method), version "WI-T3.0.0.30663 Firebird 3.0 
Alpha 1"
Firebird/x86/Windows NT (remote server), version "WI-T3.0.0.30663 Firebird 3.0 
Alpha 1/tcp (CSMIRROR)/P12"
Firebird/x86/Windows NT (remote interface), version "WI-V2.5.3.26661 Firebird 
2.5/tcp (csprog)/P12"
on disk structure version 12.0
SQL> select q.n, case when q.n=0 then 'zero' when q.n<>0 then 'NON-zero' else 
'Hm!..' end what_is_n
CON> from (select 0 N from RDB$DATABASE) q;

           N WHAT_IS_N
============ =========
           0 zero -- thats of course OK.

PS. Same  'Hm!..' result for other data types:

select q.n, case when q.n='a' then 'a' when q.n<>'a' then 'NON-a' else 'Hm!..' 
end what_is_n
from (select 'a' N from RDB$DATABASE) q;

select q.n, case when q.n=current_date then 'current_date' when 
q.n<>current_date then 'NON-current_date' else 'Hm!..' end what_is_n
from (select current_date N from RDB$DATABASE) q;


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to