[Dbix-class] bug with find_or_new and update_or_insert, for postgres DB

Jess Robinson castaway at desert-island.me.uk
Mon Jan 7 23:46:05 GMT 2008




On Mon, 7 Jan 2008, Patrick Weemeeuw wrote:

> So, I don't know whether the find_or_new method should create an embryonic row
> that satisfies the conditions of the where clause, or not. In the first case
> the where-clause values are copied to the row, in the other case they are
> not. And I am certainly not confident enough in SQL semantics to have much of
> an opinion what should happen with an undef/NULL value in the where clause.

(I may have chopped too much there, but this was getting long).

There may be a DB where submitting NULL to a NOT NULL field which is 
auto-inc does the required thing, but it's not sane, IMO.

Most prefer either "don't supply it" or want "DEFAULT" instead which is 
saner and iirc standard.

If the system you are using does this on purpose, take it out and shoot 
it.. or fix it.

Jess



More information about the DBIx-Class mailing list