Subject Re: [firebird-support] Question: RDB$SYSTEM_FLAG = 0 No Results
Author Robert Tulloch
On 2/27/2019 1:27 PM, helebor@... [firebird-support] wrote:
 

Robert Tulloch wrote,

>[Mark Rotteveel]
>  No, the flag is null, not 0, otherwise = 0 had worked, and is null
> had not. You appear to be using a query tool that renders null as 0.

Such as the GUI tool that was distributed with IB6 - ibadmin, or
something like that?  And several other Delphi GUI tools at that time,
because most Delphi components couldn't represent NULL.

And don't forget that everything in the IB6 distribution was Beta.
IB6 was never released.

You'd get proper results if you used isql and ran the right query.
Your query

select cast (RDB$RELATION_NAME as varchar(32)) AS TABLE_NAME,
       cast (RDB$INDEX_NAME as varchar(32)) AS INDEX_NAME,
       RDB$STATISTICS
from rdb$indices
where 0 = 0 AND RDB$SYSTEM_FLAG = 1
order by RDB$STATISTICS DESC

will produce *only* rows where RDB$SYSTEM_FLAG = 1

This one (with mods to make it sensible):
select RDB$RELATION_NAME,
       RDB$INDEX_NAMEE,
       RDB$STATISTICS
from rdb$indices
where RDB$SYSTEM_FLAG = 0
order by 3 DESC

produces *only* rows where RDB$SYSTEM_FLAG = 0

which means no rows at all, because at that stage nobody had done the
required bug-fixing and cleanup of the IB6 code.

This one:

select RDB$RELATION_NAME,
       RDB$INDEX_NAMEE,
       RDB$STATISTICS
from rdb$indices
where RDB$SYSTEM_FLAG is null
or RDB$SYSTEM_FLAG = 0
order by 3 DESC

produces the rows for the user-defined indices.

>Can I send you a screenshot of the flags in RDB$RELATIONS?

No point - it would only serve to illustrate what Mark already told
you.  Run the same queries in isql and see for yourself.

HB


Perhaps you missed my point or i missed yours.

I agree running NULL returns the user tables and no system table which is what I wanted

The fact that the flag on the user table is 0 and those tables are returned when NULL is used and not when 0 is used
was the question. So I guess it is a bug.

Thanks