Skip Menu |

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

Report information
The Basics
Id: 3797
Status: resolved
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: david [...] olrik.dk
Cc:
AdminCc:

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



Date: Tue, 16 Sep 2003 12:23:08 +0200
Subject: might_have bug + patch
From: David Jack Olrik <david [...] olrik.dk>
To: cdbi-talk [...] groups.kasei.com
Yello! I found a small problem with might_have, if data exists in the parent tabel and not in the child table the accessor methods for the child fields does not work. (it simply returns, because the child is undef) I have to tables, lets call them A & B. A->might_have('b' => 'B', qw[stuff]); Data exists in table A but not in table B. The following does not work... my $o = retrieve A(1); $o->stuff('lots'); <-- stuff nevet gets set Because the internal B is undef the accessor method just returns Here is a patch to 0.94 that fixes the problem =)

Message body is not shown because sender requested not to inline it.

//DJO
Show quoted text
> I found a small problem with might_have, if data exists in the parent > table and not in the child table the accessor methods for the child > fields does not work. (it simply returns, because the child is undef)
Thanks for this. I didn't fix it quite the way you suggested, as that would create a blank row in the remote table even on just a request. However, this should now be fixed for the new release. Tony