Subject: | Minor $dbh->tables correctness update |
The tables() method excludes VIEWs from its output by looking for rows
in rdb$relations with a NULL "rdb$view_source" field.
However, "rdb$view_blr" (the VIEW's binary language representation)
should be consulted instead.
Rationale: "rdb$view_source" is a human/administrative convenience
which may be NULLified without breaking a VIEW. See, for instance, the
Firebird FAQ "How to protect my metadata from users?" at
http://www.firebirdfaq.org/faq32/ .
Patch attached.
Subject: | dbd-interbase-0_48-view_blr.patch |
diff --git a/InterBase.pm b/InterBase.pm
index f25bc97..1568231 100644
--- a/InterBase.pm
+++ b/InterBase.pm
@@ -169,10 +169,10 @@ sub tables
my @row;
my $sth = $dbh->prepare(q{
- SELECT rdb$relation_name
- FROM rdb$relations
- WHERE (rdb$system_flag IS NULL OR rdb$system_flag = 0)
- AND rdb$view_source IS NULL;
+ SELECT rdb$relation_name
+ FROM rdb$relations
+ WHERE (rdb$system_flag IS NULL OR rdb$system_flag = 0)
+ AND rdb$view_blr IS NULL;
}) or return undef;
$sth->{ChopBlanks} = 1;