[Dbix-class] dirty-flag on inflated columns
Matt S Trout
dbix-class at trout.me.uk
Wed May 13 16:23:02 GMT 2009
On Tue, May 12, 2009 at 01:51:00PM -0700, Marc Mims wrote:
> * Matt S Trout <dbix-class at trout.me.uk> [090512 11:34]:
> > On Mon, May 11, 2009 at 12:14:07PM -0700, Marc Mims wrote:
> > > * Matt S Trout <dbix-class at trout.me.uk> [090511 10:29]:
> > > > Thoughts on whether make_column_dirty should clear the deflated value if an
> > > > inflated one is present, guys?
> > >
> > > That would break DBIx::Class::InflateColumn::FS, causing it to leave an
> > > orphaned file in the file system.
> >
> > Why?
>
> FS uses the deflated value to determine whether it needs to overwrite an
> existing file or create a new file. If the deflated value is cleared by
> make_column_dirty, FS will always make a copy, potentially orphaning a
> file in fs_column_path.
That's a bug. Deflation should not be dependent on the deflated value even
being there - store_inflated_column for e.g. deletes the deflated value.
So your code was already broken, you just hadn't noticed yet - doc patches
to ::InflateColumn on writing safe inflators very welcome :)
--
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
Technical Director and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
mst (@) shadowcat.co.uk http://shadowcat.co.uk/blog/matt-s-trout/
More information about the DBIx-Class
mailing list