Skip Menu |

This queue is for tickets about the Class-DBI-mysql-FullTextSearch CPAN distribution.

Report information
The Basics
Id: 11892
Status: stalled
Priority: 0/
Queue: Class-DBI-mysql-FullTextSearch

People
Owner: Nobody in particular
Requestors: riley [...] shunpiker.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From: "Riley Lynch" <riley [...] shunpiker.org>
Date: Tue, 15 Mar 2005 22:02:06 +0000
To: bug-Class-DBI-mysql-FullTextSearch [...] rt.cpan.org
Subject: "create" trigger clobbers mysql_insertid on insert
A Class::DBI class with a registered search function cannot recover mysql_insertid after inserting a row, because the action of the "create" trigger clobbers that value. Here is a debugger's-eye-view of the problem: DB<12> x $$MySQLClass::MyBase::_dbh->{mysql_insertid} 0 355 DB<13> l 602==> $self->call_trigger('create', discard_columns => \@discard_columns); # XXX 603 604 # Empty everything back out again! 605: $self->_attribute_delete(@discard_columns); 606: $self->call_trigger('after_create'); 607: return $self; 608 } DB<13> n Class::DBI::_create(/opt/third-party/lib/perl-5.6.0/site/Class/DBI.pm:605): 605: $self->_attribute_delete(@discard_columns); DB<13> x $$MySQLClass::MyBase::_dbh->{mysql_insertid} 0 0 Since $dbh->{mysql_insertid} shrugs off any attempt to local'ize it or assign to it, it looks like it's up to this class to stash away a copy in case the caller needs to see it. Hope this is helpful, Riley Lynch Seattle
[riley@shunpiker.org - Tue Mar 15 17:08:56 2005]: Show quoted text
> A Class::DBI class with a registered search function cannot recover > mysql_insertid after inserting a row, because the action of the > "create" trigger clobbers that value.
Do you have a test script that shows this problem? I can understand it in theory, but I have code that uses Mysql and auto-increment with this module that seems to work just fine ... Thanks, Tony