Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 133179
Status: open
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

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



Subject: New error in 0.082842 with primary key that lacks auto_increment
After upgrading to 0.082842 I see a lot of errors (on basically any 'insert' operation) like: "DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'id' on <table name> - perhaps you forgot to set its 'is_auto_increment' attribute during add_columns()? Treating 'id' implicitly as an autoinc, and attemptingvalue retrieval". I define my primary keys like this in sql (postgres 10): create table foo ( id uuid default public.gen_random_uuid() not null, ..., ); and like this in the result class: __PACKAGE__->add_columns( "id", { data_type => "uuid", default_value => \"gen_random_uuid()", is_nullable => 0, size => 16, }, ..., ); Therefore, for any row being ->inserted, I do not supply the id field, instead expecting it to be populated db-side and included on retrieval. Looking at the Changes file, there are a few fixes mentioned that relate to primary keys and auto_increment. Commit 03852844a3e looks especially relevant. The newly-carping code should also be checking if a non-supplied PK has a defined 'default'.
Subject: Re: [rt.cpan.org #133179] New error in 0.082842 with primary key that lacks auto_increment
Date: Thu, 20 Aug 2020 09:54:14 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] leporine.io>
On 08/18/2020 01:47 AM, Karen Etheridge via RT wrote: Show quoted text
> Mon Aug 17 19:47:48 2020: Request 133179 was acted upon. > Transaction: Ticket created by ETHER > Queue: DBIx-Class > Subject: New error in 0.082842 with primary key that lacks auto_increment > Broken in: 0.082842 > Severity: (no value) > Owner: Nobody > Requestors: ether@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=133179 > > > > After upgrading to 0.082842 I see a lot of errors (on basically any 'insert' operation)
Errors or warnings? This is supposed to only warn... I will look at the trigger in a few days. A patch-proposal will speed things up...
On 2020-08-20 01:03:56, RIBASUSHI wrote: Show quoted text
> On 08/18/2020 01:47 AM, Karen Etheridge via RT wrote:
> > Mon Aug 17 19:47:48 2020: Request 133179 was acted upon. > > Transaction: Ticket created by ETHER > > Queue: DBIx-Class > > Subject: New error in 0.082842 with primary key that lacks > > auto_increment > > Broken in: 0.082842 > > Severity: (no value) > > Owner: Nobody > > Requestors: ether@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=133179 > > > > > > > After upgrading to 0.082842 I see a lot of errors (on basically any > > 'insert' operation)
> > Errors or warnings? This is supposed to only warn... I will look at > the > trigger in a few days. A patch-proposal will speed things up...
Code kept running, so these were warnings.