On Thu, Mar 25, 2004 at 09:51:29AM -0500, Rudy Lippan wrote:
> 
> Tim,
> 
> I ran into some problems with last_insert_id() while trying to implement
> it for DBD::mysql 3.0. I have subjoined a patch against DBI 1.42 with the
> changes that I made so that I could get last_insert_id() working from the
> DBD.
> 
> Thoughts, suggestions?
> 
> Rudy.
> 
> 
> --- DBI-1.42/dbd_xsh.h        2004-02-15 17:15:20.000000000 -0500
> +++ DBI-1.42-working/dbd_xsh.h        2004-03-20 17:54:01.318300272 -0500
> -SV   *dbd_db_last_insert_id _((SV *dbh, SV        *imp_dbh, SV *catalog, SV 
> *schema, SV *table, SV *field, SV *attr));
> +SV   *dbd_db_last_insert_id _((SV *dbh, imp_dbh_t *imp_dbh, SV *catalog, SV 
> *schema, SV *table, SV *field, SV *attr));

Yeap, bug.

> diff -ru DBI-1.42/DBI.pm DBI-1.42-working/DBI.pm
> --- DBI-1.42/DBI.pm   2004-03-11 08:45:38.000000000 -0500
> +++ DBI-1.42-working/DBI.pm   2004-03-20 17:57:22.818667560 -0500
> @@ -383,7 +383,7 @@
> -     last_insert_id  => { U =>[3,4,'$table_name, $field_name [, \%attr ]'],     
> O=>0x2100 },
> +     last_insert_id  => { U =>[5,6,'$table_name, $field_name [, \%attr ]'],     
> O=>0x2820 },

Yeap, bug. But I think it should be:

  +     last_insert_id  => { U =>[5,6,'$catalog, $schema, $table_name, $field_name [, 
\%attr ]'],     O=>0x2820 },

I'll make those changes. Thanks!

Tim.

p.s. I'd recommend using subversion to keep track of the latest DBI source.

Reply via email to