Skip Menu |

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

Report information
The Basics
Id: 107462
Status: patched
Priority: 0/
Queue: DBIx-Class

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

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



Subject: regression with add_column
`add_column` used to work in 0.08270, but not anymore in recent versions. To reproduce ============ 1. Prepare database: #!/bin/sh pg_ctl init -D var/db pg_ctl -D var/db start sleep 3 createdb -e dbictest psql dbictest <<SQL create table queue ( id bigserial primary key, submitted timestamp with time zone default now(), visible boolean not null default true ); insert into queue default values; SQL 2. Install dependencies: cpanm DBD::Pg DateTime DateTime::Format::Pg \ DBIx::Class::InflateColumn::DateTime DBIx::Class::Schema::Loader cpanm -l old-dbic DBIx::Class@0.08270 3. Run the program: use 5.010; use strict; use warnings; # use lib 'old-dbic/lib/perl5'; use DateTime qw(); require DateTime::Format::Pg; require DBIx::Class::InflateColumn::DateTime; use DBIx::Class::Schema::Loader qw(); require DBD::Pg; DBIx::Class::Schema::Loader->loader_options( components => 'InflateColumn::DateTime', naming => {ALL => 'preserve'}, ); for my $q ( DBIx::Class::Schema::Loader->connect( 'dbi:Pg:dbname=dbictest', undef, undef, { pg_enable_utf8 => 1 } )->resultset('Queue')->search( { visible => 1 }, { order_by => 'submitted' } )->all ) { $q->add_column('eta'); $q->eta(DateTime->now); } say 'survived'; Expected ======== Message "survived". You can see this used to work when you uncomment line 4. Actual ====== Throws error: DBIx::Class::Row::get_column(): No such column 'eta' on DBIx::Class::Schema::Loader::Result::Queue at add-col.pl line 23
Subject: Re: [rt.cpan.org #107462] regression with add_column
Date: Fri, 02 Oct 2015 22:02:14 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 10/02/2015 01:19 PM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 via RT wrote: Show quoted text
> `add_column` used to work in 0.08270, but not anymore in recent versions.
Hm... I need to look deeper into this before going "here is the fix". There are couple more regressions in the queue before this one, expect an answer sometime Wednesday. Thanks!
Subject: Re: [rt.cpan.org #107462] regression with add_column
Date: Mon, 12 Oct 2015 13:05:44 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 10/02/2015 01:19 PM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 via RT wrote: Show quoted text
> > Throws error: > > DBIx::Class::Row::get_column(): No such column 'eta' on > DBIx::Class::Schema::Loader::Result::Queue at add-col.pl line 23
Sorry for the delay with this, I am still trying to figure out how to go forward. The culprit is this consolidation: https://github.com/dbsrgits/dbix-class/commit/4006691d I will get something together in the coming days, in the meantime (if possible) stay on 08270 a tad longer.
On Mon Oct 12 13:06:07 2015, RIBASUSHI wrote: Show quoted text
> On 10/02/2015 01:19 PM, Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 via RT wrote:
> > > > Throws error: > > > > DBIx::Class::Row::get_column(): No such column 'eta' on > > DBIx::Class::Schema::Loader::Result::Queue at add-col.pl line 23
> > Sorry for the delay with this, I am still trying to figure out how to go > forward. The culprit is this consolidation: > https://github.com/dbsrgits/dbix-class/commit/4006691d > I will get something together in the coming days, in the meantime (if > possible) stay on 08270 a tad longer. >
In fact I managed to front-run this very bug in a conjecture at the end of this commit message: https://github.com/dbsrgits/dbix-class/commit/350e8d57 TLDR: I recognize this is a regression, I just didn't realize at the time how seriously it could affect end-user code. I will come up with something to address this shortly, as you can see it's not a trivial "go back" action :/
On Mon Oct 12 13:11:23 2015, RIBASUSHI wrote: Show quoted text
> TLDR: I recognize this is a regression, I just didn't realize at the > time how seriously it could affect end-user code. I will come up with > something to address this shortly, as you can see it's not a trivial > "go back" action :/
Correctly fixing this is ending up much harder than I originally anticipated. It is almost at the top of the stack of "todos" now. Sorry for the massive delay :/
Subject: [rt.cpan.org #107462] Related issue with virtual view
Date: Fri, 22 Jan 2016 10:31:48 +0000
To: bug-DBIx-Class [...] rt.cpan.org
From: Dave Howorth <dhoworth [...] mrc-lmb.cam.ac.uk>
There is a related issue discussed in the mail thread starting at http://lists.scsys.co.uk/pipermail/dbix-class/2016-January/012127.html Previously working code using a virtual view no longer works. See the mail thread for more details. Cheers, Dave
RT-Send-CC: dhoworth [...] mrc-lmb.cam.ac.uk
On Mon Oct 12 13:11:23 2015, RIBASUSHI wrote: Show quoted text
> TLDR: I recognize this is a regression, I just didn't realize at the > time how seriously it could affect end-user code. I will come up with > something to address this shortly, as you can see it's not a trivial > "go back" action :/
Well, the wait is finally over - the problem is fully nailed in https://github.com/dbsrgits/dbix-class/commit/f064a2abb158 Extra precautions were taken to make sure the user won't be left stranded in https://github.com/dbsrgits/dbix-class/commit/73f54e275e Apologies it took *that* long - more details on why in this writeup: https://github.com/dbsrgits/dbix-class/commit/1cf609901b03
Bugfix confirmed in 0.082899_25 for both the simplified example in this ticket and my code in production.