URGENT RE: [Zope] ZmysqlDA

Andy Dustman andy@dustman.net
29 May 2002 14:45:52 -0400


On Wed, 2002-05-29 at 14:11, Oliver Marx wrote:
> So the DA's are using the column names as id for objects?
> 
> Then problem only arises with a select * ... in other cases one could just
> use
> select table1.postal_id, table2.postal_id ...
> 
> problem gone!

Don't think so: You still have two columns with the same name.

> But but but.....
> 
> ZmysqlDA should *not* abstruct the SQL92 definition...

The "problem" is, Zope requires a DA to return each row as a dictionary,
and a dictionary cannot have two items with the same key. You could
overwrite one value with another, but then you'd have no deterministic
way of knowing which column you actually got. In this case, they are
actually the same value, due to the JOIN condition, but that's not true
in the general case. So an exception is raised to alert you to this
condition.

-- 
Andy Dustman         PGP: 0x930B8AB6
    @       .net     http://dustman.net/andy
"Cogito, ergo sum." -- Rene Descartes
"I yam what I yam and that's all that I yam." -- Popeye