Skip Menu |

This queue is for tickets about the DBD-Mock CPAN distribution.

Report information
The Basics
Id: 91055
Status: resolved
Priority: 0/
Queue: DBD-Mock

People
Owner: Nobody in particular
Requestors: zurom [...] mail.ru
Cc:
AdminCc:

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



Subject: "insert IGNORE" doesn't raise last_insert_id
Date: Fri, 29 Nov 2013 17:43:47 +0400
To: bug-DBD-Mock [...] rt.cpan.org
From: Roman <zurom [...] mail.ru>
DBD::Mock v1.43 (maybe later versions too) This code doesn't work for 'insert *IGNORE *into Table' statement $dbh->{mock_start_insert_id} = ['Table', 100500]; After $dbh->do('insert ignore into Table...') $dbh->last_insert_id() returns "undef" *Without 'ignore*' it's work fine
Subject: insert IGNORE doesn't raise last_insert_id
From: zurom [...] mail.ru
The proble is in this regexp (DBD::Mock::st line 130): if ( $dbh->{Statement} =~ /^\s*?insert\s+into\s+(\S+)/i ) {
On Fri Nov 29 08:44:13 2013, zurom wrote: Show quoted text
> > DBD::Mock v1.43 (maybe later versions too) > > This code doesn't work for 'insert *IGNORE *into Table' statement > $dbh->{mock_start_insert_id} = ['Table', 100500]; > > After > $dbh->do('insert ignore into Table...') > > $dbh->last_insert_id() returns "undef" > > *Without 'ignore*' it's work fine
Hi, I've recently picked up support for DBD::Mock and had a look at this. There's now a fix for this in the DBD::Mock codebase and it'll be in the next release (v1.48). Regards, Jason.
On Mon Sep 09 05:12:33 2019, JLCOOPER wrote: Show quoted text
> On Fri Nov 29 08:44:13 2013, zurom wrote:
> > > > DBD::Mock v1.43 (maybe later versions too) > > > > This code doesn't work for 'insert *IGNORE *into Table' statement > > $dbh->{mock_start_insert_id} = ['Table', 100500]; > > > > After > > $dbh->do('insert ignore into Table...') > > > > $dbh->last_insert_id() returns "undef" > > > > *Without 'ignore*' it's work fine
> > Hi, > I've recently picked up support for DBD::Mock and had a look at > this. There's now a fix for this in the DBD::Mock codebase and it'll > be in the next release (v1.48). > > Regards, > Jason.
Hi, DBD::Mock v1.48 was released at the end of last week (quickly followed by v1.49 that resolved some issues with old Perl versions). The new version includes a fix for the Insert Ignore issue, so I'll close this case, but if you find any problems with then open an new case and I'll take another look at it. Regards, Jason.