Subject: | SchemaTest tweak |
Date: | Mon, 07 Feb 2011 10:08:56 +0000 |
To: | bug-test-dbix-class-schema [...] rt.cpan.org |
From: | Darius Jokilehto <darius.jokilehto [...] net-a-porter.com> |
Hey Chisel,
I've been writing a whole lot of T::DBIC::Schema tests recently and I've
come across an issue where tables with many rows (> 4M in my case) give
an OOM memory as the column test calls get_column on all rows of the table.
I've come up with a tweak that should resolve this, as well as making
the test quite a lot faster... apologies for not sending you a diff
(lazy Darius), but here's the tweak:
On line 136 replace:
my $col = $rs->get_column($method)->all;
with
my $col = $rs->slice(0,0)->get_column($method)->all;
Basically just adds a limit 1 to the query.
Hope you can get it onto CPAN before the next release!
Cheers,
Darius
NET-A-PORTER.COM
Irresistible fashion at your fingertips
Show quoted text
______________________________________________________________________
CONFIDENTIALITY NOTICE
The information in this email is confidential and is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you must not read, use or disseminate the information. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Net a Porter Ltd.
Net A Porter Ltd is a company registered in England & Wales Number: 3820604 Registered Office: 1 The Village Offices, Westfield, Ariel Way, London, W12 7GF
_____________________________________________________________________