On Tue, Jun 29, 2004 at 08:05:26AM +0200, Michael Peppler wrote:
> On Tue, 2004-06-29 at 00:31, Tim Bunce wrote:
> > A release candidate for DBI 1.43 is available for testing at:
> > 
> >   http://homepage.eircom.net/~timbunce/DBI-1.43-rc1-20040628.tar.gz
> > 
> > =head1 CHANGES in DBI 1.43 (svn rev 373),    28th June 2004
> > 
> 
> >   Fixed last_insert_id(...) usage check thanks to Rudy Lippan.
> 
> Hmmm.
> 
> I've got last_insert_id() in DBD::Sybase::db, but it doesn't get called
> from the dispatcher.
> 
>     DBI 1.43-ithread default trace level set to 0x0/10 (pid 2880)
>     Note: perl is running without the recommended perl -w option
>     >> last_insert_id DISPATCH (DBI::db=HASH(0xa0c926c) rc1/1 @5 g0
> ima2101 pid#2880) at t/main.t line 166
> not ok 17
> 
> The code:
> 
> if($DBI::VERSION > 1.42) {
>     # This will only work w/ DBI >= 1.43
>     $dbh->do("create table #idtest(id numeric(9,0) identity, c
> varchar(20))");
>     $dbh->do("insert #idtest (c) values ('123456')");
>     DBI->trace(10);
>     my $value = $dbh->last_insert_id(undef,undef,undef,undef);
>     if($value > 0) {
>       print "ok 17\n";
>     } else {
>       print "not ok 17\n";
>     }
>     DBI->trace(0);
> }
> 
> This worked when I applied Rudy's patch (in particular the O=>0x2820 vs.
> O=>0x2100) to 1.42.

Ah. It's using
        IMA_SHOW_ERR_STMT|IMA_STUB (0x2100)
instead of
        IMA_SHOW_ERR_STMT|IMA_NOT_FOUND_OKAY (0x2800)

I probably applied Rudy's change by hand and missed that part.
Fixed now. Thanks.

Tim.

p.s. I'm not keen in adding 0x0020 (IMA_NO_TAINT_OUT). The only methods that
use it currently are quote() and quote_indentifier(). If TaintOut is
enabled (implying that you don't trust the database/server) then I
think it's reasonable for last_insert_id to be tainted.

Reply via email to