[Zope] More ZMySQLDA troubleshooting w/ Zope 2.0.0

Andy Dustman adustman@comstar.net
Thu, 16 Sep 1999 12:57:28 -0400 (EDT)


On Thu, 16 Sep 1999, ben andrew fulton wrote:

> After some trial and error, I discovered that db.py is apparently
> bombing on columns of type bigint and mediumint. "sessioncode" in the
> above example is a bigint column type, and if I select a char, decimal,
> or smallint column instead, the query runs fine (although an unsigned
> smallint will come back with an "L" appended to each number). I'm now
> using MySQL version 3.22.25-log after upgrading my Debian installation
> to unstable for the hell of it. Any idea what might be causing this
> problem, and if there's a workaround I can implement in my query? Will
> the MySQL db interface for Python that was just released into beta
> handle this situation better?

There is a dictionary in ZMySQLDA which maps MySQL column types to certain
format codes. Look in lib/python/Products/ZMySQLDA/db.py around line 120
in class DB, attribute defs. You can probably add another element or two
to accomodate these types.

The other thing you can do is try the newer MySQLdb-0.1.0, and apply the
enclosed ZMySQLDA.patch. I reworked this some more yesterday and I think
it's pretty close to being finished. At least, I've done some testing on
it and can't find a case where it's borken. The only suspected place where
there will probably be trouble is if you have some LONG LONG columns. In
fact, I just dug through lib/python/shared/DC/ZRDB/RDB.py and it appears
the correct code I should be using is "l" there. I just now fixed this,
and the updated tarball is available at:

	http://starship.python.net/crew/adustman

So... now there are no known bugs. :)

-- 
andy dustman       |     programmer/analyst     |      comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d