Author: timbo
Date: Tue May 27 04:08:12 2008
New Revision: 11326
Modified:
dbi/trunk/Changes
dbi/trunk/DBI.pm
dbi/trunk/DBI.xs
dbi/trunk/Driver.xst
dbi/trunk/README
dbi/trunk/dbixs_rev.h
dbi/trunk/lib/DBI/PurePerl.pm
dbi/trunk/t/02dbidrv.t
dbi/trunk/t/70callbacks.t
Log:
Added $drh->dbixs_revision method (undocumented, only for problem diagnosis)
Tidied TODO and updated copyright year.
Added note about generic 'transparent' callback to t/70callbacks.t.
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Tue May 27 04:08:12 2008
@@ -8,17 +8,27 @@
Assorted TODO notes:
-Protect trace_msg from SIGPIPE?
-prepare(...,{ Err=>\my $isolated_err, ...})
-Move _new_sth to DBI::db::_new_sth (leave alias) and implement in C
-Implement FETCH_many() in C
-Or call _new_child and move to DBI::common?
-Add trace modules that just records the last N trace messages into an array
-and prepends them to any error message.
-Document DBI_PROFILE_FLOCK and LockFile attrib in DBI::ProfileData and
DBI::ProfileDumper
+General:
+ Protect trace_msg from SIGPIPE?
+ prepare(...,{ Err=>\my $isolated_err, ...})
+ Add trace modules that just records the last N trace messages into an array
+ and prepends them to any error message.
+ Document DBI_PROFILE_FLOCK and LockFile attrib in DBI::ProfileData and
DBI::ProfileDumper
+Performance:
+ Move _new_sth to DBI::db::_new_sth (leave alias) and implement in C
+ Or call _new_child and move to DBI::common?
+ Implement FETCH_many() in C
Gofo TODOs:
+Add server-side caching.
+ combine these:
+ my $request = $transport->thaw_request( $frozen_request );
+ my $response = $executor->execute_request( $request );
+ my $frozen_response = $transport->freeze_response($response);
+ into single method that first checks the cache
+ and updates it if appropriate
+
Move post-request cleanup into separate method and enable hooks so
it can be done after the response has been sent
Gofer - allow dbh attrib changes after connect?
@@ -30,10 +40,10 @@
- return current executor stats as an attribute - handy for tests
- will accept streamed resultsets
Add attr-passthru to prepare()? ie for gofer cache control & ReadOnly
-Terminology for client and server ends
+Define and document terminology for client and server ends
Document user/passwd issues at the various levels of the gofer stack
Remove "Password" from connect attr if the same as $password arg
-Policy's from pod
+Extract policy settings by parsing the pod
Policy for dbh attr FETCH (ie example_driver_path)
or piggyback on skip_connect_check
could also remember which attr have been returned to us
@@ -55,6 +65,8 @@
Increased timeout on tests to accomodate very slow systems.
Removed the beeps "\a" from Makefile.PL warnings.
Removed check for PlRPC-modules from Makefile.PL
+ Added cache miss trace message to DBD::Gofer transport class.
+ Added $drh->dbixs_revision method.
Clarified docs re ":N" style placeholders.
Added explicit LICENSE specification (perl) to META.yaml
Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm (original)
+++ dbi/trunk/DBI.pm Tue May 27 04:08:12 2008
@@ -1,7 +1,7 @@
# $Id$
-# vim: ts=8:sw=4
+# vim: ts=8:sw=4:noet
#
-# Copyright (c) 1994-2007 Tim Bunce Ireland
+# Copyright (c) 1994-2008 Tim Bunce Ireland
#
# See COPYRIGHT section in pod text below for usage and distribution rights.
#
@@ -404,6 +404,7 @@
'disconnect_all'=>{ U =>[1,1], O=>0x0800 },
data_sources => { U =>[1,2,'[\%attr]' ], O=>0x0800 },
default_user => { U =>[3,4,'$user, $pass [, \%attr]' ] },
+ dbixs_revision => $keeperr,
},
db => { # Database Session Class Interface
data_sources => { U =>[1,2,'[\%attr]' ], O=>0x0200 },
@@ -7506,7 +7507,7 @@
=head1 COPYRIGHT
-The DBI module is Copyright (c) 1994-2004 Tim Bunce. Ireland.
+The DBI module is Copyright (c) 1994-2008 Tim Bunce. Ireland.
All rights reserved.
You may distribute under the terms of either the GNU General Public
Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs (original)
+++ dbi/trunk/DBI.xs Tue May 27 04:08:12 2008
@@ -4312,6 +4312,16 @@
}
+MODULE = DBI PACKAGE = DBD::_::dr
+
+void
+dbixs_revision(h)
+ SV * h
+ CODE:
+ PERL_UNUSED_VAR(h);
+ ST(0) = sv_2mortal(newSViv(DBIXS_REVISION));
+
+
MODULE = DBI PACKAGE = DBD::_::db
void
Modified: dbi/trunk/Driver.xst
==============================================================================
--- dbi/trunk/Driver.xst (original)
+++ dbi/trunk/Driver.xst Tue May 27 04:08:12 2008
@@ -30,6 +30,12 @@
MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::dr
+void
+dbixs_revision(...)
+ PPCODE:
+ ST(0) = sv_2mortal(newIV(DBIXS_REVISION));
+
+
#ifdef dbd_discon_all
# disconnect_all renamed and ALIAS'd to avoid length clash on VMS :-(
Modified: dbi/trunk/README
==============================================================================
--- dbi/trunk/README (original)
+++ dbi/trunk/README Tue May 27 04:08:12 2008
@@ -1,16 +1,11 @@
DBI - The Perl Database Interface by Tim Bunce.
-Copyright (c) 1994-2004 Tim Bunce Ireland.
+Copyright (c) 1994-2008 Tim Bunce Ireland.
See COPYRIGHT section in DBI.pm for usage and distribution rights.
See GETTING HELP section in DBI.pm for how to get help.
-RECENT NEWS:
-
- Note: There is a bug in perl 5.8.2 when configured with threads
- and debugging enabled (bug #24463) which causes a DBI test to fail.
-
QUICK START GUIDE:
The DBI requires one or more 'driver' modules to talk to databases,
Modified: dbi/trunk/dbixs_rev.h
==============================================================================
--- dbi/trunk/dbixs_rev.h (original)
+++ dbi/trunk/dbixs_rev.h Tue May 27 04:08:12 2008
@@ -1,4 +1,4 @@
-/* Mon Mar 10 14:00:00 2008 */
-/* Mixed revision working copy (10706M:10899) */
+/* Fri May 9 13:27:00 2008 */
+/* Mixed revision working copy (10993M:11152) */
/* Code modified since last checkin */
-#define DBIXS_REVISION 10706
+#define DBIXS_REVISION 10993
Modified: dbi/trunk/lib/DBI/PurePerl.pm
==============================================================================
--- dbi/trunk/lib/DBI/PurePerl.pm (original)
+++ dbi/trunk/lib/DBI/PurePerl.pm Tue May 27 04:08:12 2008
@@ -882,6 +882,13 @@
}
package
+ DBD::_::dr;
+
+sub dbixs_revision {
+ return 0;
+}
+
+package
DBD::_::db;
sub connected {
Modified: dbi/trunk/t/02dbidrv.t
==============================================================================
--- dbi/trunk/t/02dbidrv.t (original)
+++ dbi/trunk/t/02dbidrv.t Tue May 27 04:08:12 2008
@@ -4,7 +4,7 @@
use strict;
-use Test::More tests => 51;
+use Test::More tests => 53;
## ----------------------------------------------------------------------------
## 02dbidrv.t - ...
@@ -233,6 +233,9 @@
ok(!$drh->disconnect_all, '... calling $drh->disconnect_all (not implemented
but will fail silently)');
+ok defined $drh->dbixs_revision, 'has dbixs_revision';
+ok($drh->dbixs_revision =~ m/^\d+$/, 'has integer dbixs_revision');
+
SKIP: {
skip "using DBI::PurePerl", 5 if $DBI::PurePerl;
my $can = $drh->can('FETCH');
Modified: dbi/trunk/t/70callbacks.t
==============================================================================
--- dbi/trunk/t/70callbacks.t (original)
+++ dbi/trunk/t/70callbacks.t Tue May 27 04:08:12 2008
@@ -165,3 +165,18 @@
is $called{cached}, 1, "connect_cached.reused called";
is $called{new}, 1, "connect_cached.new not called again";
+__END__
+
+A generic 'transparent' callback looks like this:
+(this assumes only scalar context will be used)
+
+ sub {
+ my $h = shift;
+ return if our $avoid_deep_recursion->{"$h $_"}++;
+ my $this = $h->$_(@_);
+ undef $_; # tell DBI not to call original method
+ return $dbh; # tell DBI to return this instead
+ };
+
+XXX should add a test for this
+XXX even better would be to run chunks of the test suite with that as a '*'
callback. In theory everything should pass (except this test file, naturally)..