Author: turnstep
Date: Mon Aug 18 19:14:33 2008
New Revision: 11666
Modified:
DBD-Pg/trunk/Changes
DBD-Pg/trunk/Pg.pm
Log:
Quick little idea from a tracing discussion. Comments welcome.
Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes (original)
+++ DBD-Pg/trunk/Changes Mon Aug 18 19:14:33 2008
@@ -1,5 +1,9 @@
('GSM' is Greg Sabino Mullane, [email protected])
+2.10.0
+
+ - Add the 'DBD' trace setting to output only non-DBI trace messages. [GSM]
+
2.9.2 Released August 18, 2008 (subversion r11664)
- Empty Postgres arrays should return empty Perl arrays, not undef.
Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm (original)
+++ DBD-Pg/trunk/Pg.pm Mon Aug 18 19:14:33 2008
@@ -80,6 +80,7 @@
## These two methods are here to allow calling before connect()
sub parse_trace_flag {
my ($class, $flag) = @_;
+ return 0x7FFFFF00 if $flag eq 'DBD';
return 0x01000000 if $flag eq 'pglibpq';
return 0x02000000 if $flag eq 'pgstart';
return 0x04000000 if $flag eq 'pgend';
@@ -1921,6 +1922,10 @@
$h->trace($h->parse_trace_flags('SQL|pglibpq'));
$h->trace($h->parse_trace_flags('1|pgstart'));
+ ## Simpler:
+ $h->trace('SQL|pglibpq');
+ $h->trace('1|pgstart');
+
my $value = DBD::Pg->parse_trace_flag('pglibpq');
DBI->trace($value);
@@ -1950,6 +1955,11 @@
For maximum portability of output (but with a potential performance
hit), use with C<$dbh->{pg_server_prepare} = 0>
+=item DBD
+
+Turns on all non-DBI flags, in other words, only the ones that are specific
+to DBD::Pg (all those below which start with the letters 'pg').
+
=item pglibpq
Outputs the name of each libpq function (without arguments) immediately
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.