patch for DBI 1.47

2005-03-07 Thread Jens Hinrichs
Hallo,
in an older version of DBI (i think it was 1.43) there was an warning
in line 1317.
Use of uninitialized value in concatencation (.) or string at...
in the 1.47 Version the bug is fixed in an (for me) unclean way:
my $key =  do{ local $^W; # silence undef warnings
...
}
if fixed that problem in another way with map.
I think it is the better way to do it.
my $key = join ~~, $dsn, $user||'', $auth||'', map { defined $_ ? $_ 
: '' } $attr ? ( @attr_keys, @[EMAIL PROTECTED] ) : ();

My patch is attached.
Regardz Jens Hinrichs



DBI_1.47_patched.diff
Description: Binary data


Re: Savepoint support proposal

2005-03-07 Thread Tim Bunce
On Sun, Mar 06, 2005 at 08:41:01PM -0800, Dean Arnold wrote:
 Greg Sabino Mullane wrote:
 
 We are working on implementing savepoint support in DBD::Pg, and
 someone pointed out (quite rightly) that perhaps there should be
 DBI method support for savepoints, as they are a standard SQL
 construct used by more than just PostgreSQL. So I would like to
 propose that DBI implement a savepoint, release, and rollbackto
 method, similar to the existing begin, commit, and rollback
 methods for database handles. In short, these would be simple
 wrappers, with the actual implementation left to the DBDs. I can
 whip up a prototype and more detailed docs, but wanted to see if
 there was any input or objections before I did.
 
 Thanks,
 - --
 Greg Sabino Mullane [EMAIL PROTECTED]
 
 While I don't have any particular objections, doesn't
 Pg (and most other DBMSs supporting savepoints) have
 SQL syntax to implement them ? If so, isn't just
 
 $dbh-do(savepoint-sql)
 
 sufficient ?
 
 my 2 cents,

Mine too.

The only significant reason I can see for a specific API for savepoints
would be to support distributed transaction management (ala XA).
If that is the only significant reason then any API proposals should
be made in that context.

Tim.


Re: patch for DBI 1.47

2005-03-07 Thread Tim Bunce
On Mon, Mar 07, 2005 at 01:24:43PM +0100, Jens Hinrichs wrote:
 Hallo,
 
 in an older version of DBI (i think it was 1.43) there was an warning
 in line 1317.
 Use of uninitialized value in concatencation (.) or string at...
 
 in the 1.47 Version the bug is fixed in an (for me) unclean way:

 my $key =  do{ local $^W; # silence undef warnings
 ...
 }

Counts as simple, effective, sufficient, and efficient in my book :)

Tim.