Re: Need help with finding solution to CDBI bug

[prev] [thread] [next] [Date index for 2004/06/22]

From: Yuval Kogman
Subject: Re: Need help with finding solution to CDBI bug
Date: 23:30 on 22 Jun 2004
--GID0FwUMdk1T2AWN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 23, 2004 at 18:12:30 -0400, Charles Bailey wrote:

> I can see places where one would want either of the above; my sense is th=
at=20
> a CDBI object method id() should take the object-level view, with an=20
> analogous flat_id() or string_id() returning the db-level view.  Some of=
=20
> that is undoubtedly colored by habit: our principal CDBI application here=
=20
> uses objects as PK values, and $obj->id() is the straightforward way to g=
et=20
> those values and then operate on them.

This is my argument that we should have a Class::DBI::Key::Primary, and
some columns return an object which inherits from that as well as
Class::DBI::Key::Foreign, or whatever.

But this means breaking backwards compatibility.

> It seems like an indirect fix.  $obj->id() always returns the primary key=
,=20
> regardless of what's been done with Stringify.

That data is not stored once an inflation has happenned, and it always
happens because the primary key is always fetched.

The way to reliably get this data is to recurse into ->id's of your
primary key values, and return what they give. Due to the fact that CDBI
does not yet support multiple foreign keys, this should not break, but
mynd you, makeshifts kan be pretty nasti^H^H^H^H^Hfragile.
A makeshift once bit my sister.

> "$obj" may or may not return the primary key, depending on what the
> class has done with Stringify.  The change you've made just lets other
> code (in this case, the a DBD driver) that assumes "$obj" returns the
> primary key get away with it.

I agree in that stringifying values should not be assumed to be the key,
but Tim's fix doesn't break there.

> That's why I've suggested the fix would be better sited in=20
> DBIx::ContextualFetch - nothing from that point down needs to know about=
=20
> CDBI's object model, while code above it may actually want to work with t=
he=20
> objects in the PK.

Should it really know about CDBI internals? It's just a way to return a
proper value from $sth->fetch_whatever based on the evaluation context.

The [hard] fix that Tony mentioned would allow the retrieval of data
=66rom the attribute without inflation - id() would simply use that value,
instead of the inflated value in future versions.

--=20
 ()  Yuval Kogman <nothingmuch@xxxxxxxx.xxx> 0xEBD27418  perl hacker &
 /\  kung foo master: uhm, no, I think I'll sit this one out..: neeyah!


--GID0FwUMdk1T2AWN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFA2MEmVCwRwOvSdBgRAnxRAJ4zRzAuL+SoH7zawKGkAzXgBu7hlwCgvrMf
nmSfCNLqGB1udKFdQEYnJFw=
=5TKI
-----END PGP SIGNATURE-----

--GID0FwUMdk1T2AWN--

(message missing)

Need help with finding solution to CDBI bug
William McKee 11:40 on 19 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 13:19 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:06 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 15:14 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 15:23 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:07 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 15:30 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 15:37 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 16:12 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 16:33 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 21:47 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 08:34 on 26 Jun 2004

Re: Need help with finding solution to CDBI bug
Takes Tea at Half Past Three 17:06 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:13 on 25 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 00:10 on 26 Jun 2004

RE: Need help with finding solution to CDBI bug
robert_creager 04:34 on 03 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:17 on 05 Jul 2004

Re: Need help with finding solution to CDBI bug
Robert Creager 20:57 on 05 Jul 2004

Re: Need help with finding solution to CDBI bug
Robert Creager 00:22 on 06 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:50 on 06 Jul 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:05 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 17:18 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 17:41 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 18:04 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 19:20 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 20:16 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:34 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 14:25 on 21 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 20:03 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 22:44 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 15:16 on 24 Oct 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:15 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:33 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 17:17 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 11:38 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
merlyn (Randal L. Schwartz) 16:10 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 13:19 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:04 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 12:43 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 19:52 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 19:56 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:48 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 22:12 on 23 Jun 2004

Re: Need help with finding solution to CDBI bug
Yuval Kogman 23:30 on 22 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:08 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 13:53 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:51 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 07:12 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 13:50 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 14:55 on 24 Jun 2004

Re: Need help with finding solution to CDBI bug
Tony Bowden 16:04 on 27 Jun 2004

Re: Need help with finding solution to CDBI bug
Charles Bailey 17:53 on 27 Jun 2004

Re: Need help with finding solution to CDBI bug
William McKee 12:58 on 06 Jul 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52