[Zope] Why ZMySQLDA dies with KeyError: unhandled...

Jordan B. Baker jbb@spyderlab.com
Mon, 8 Mar 1999 11:12:06 -0500 (EST)


On Mon, 8 Mar 1999, Philip Aylesworth wrote:

> I just ran into this error. When I did a SELECT * on joined tables it would
> give the error but if I named the fields I needed it worked. I played with
> it a little and got the error again when I named a field that ended in _num
> in the SELECT. I have four such INT fields that I don't need, they are used
> by the JOIN, and have _n counterparts in the JOINed tables (see SQL below).
> As you can see my SELECT list is long and it would have been nice to just
> use a * since I need almost all the fields.
> 
> Everything works fine in MySQL client but from Zope I can produce that error.
> 
> Maybe there is some conflict with the *_num names. What are your field names?

I was able to find a work around.  The problem was the handling of
the TIMESTAMP datatype by the MySQLmodule.  It doesn't know how to handle
a long timestamp unfortunately, so you'll want to retrieve it as a UNIX
timestamp or as a formatted date using one of MySQL's many date functions.

The other thing is that I doubt it handles double long integers since
AFAIK Python doesn't handle these without an extension module.

If your query is returning any of these you'll most likely get this
response from Zope...

-------
Jordan B. Baker -- jbb@spyderlab.com
weaving the web @ http://www.spyderlab.com