[Zope] MySql and Auto_increment

Jonothan Farr jfarr@real.com
Tue, 18 Apr 2000 17:46:41 -0700


That's due to a bug in the mysql adapter. I can probably dig up my patch if
you'd like.
-jfarr

----- Original Message -----
From: Luis Cortes <lcortes@pollak.com>
To: <zope@zope.org>
Sent: Tuesday, April 18, 2000 1:40 PM
Subject: RE: [Zope] MySql and Auto_increment


> I don't know what it means by KeyError, but if I change my zsqlmethod to:
>
> select last_insert_id()
>
> I still get the key error, like so:
>
> Error, exceptions.KeyError: unhandled
>
> SQL used:
>
> select last_insert_id()
>
> Traceback (innermost last):
>   File /var/zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module
>   File /var/zope/lib/python/ZPublisher/Publish.py, line 179, in publish
>   File /var/zope/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook
>     (Object: sqlInsertTest)
>   File /var/zope/lib/python/ZPublisher/Publish.py, line 165, in publish
>   File /var/zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
>     (Object: manage_test)
>   File /var/zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
>     (Object: manage_test)
>   File /var/zope/lib/python/Shared/DC/ZRDB/DA.py, line 331, in manage_test
>     (Object: sqlInsertTest)
>   File /var/zope/lib/python/Shared/DC/ZRDB/DA.py, line 312, in manage_test
>     (Object: sqlInsertTest)
>   File /var/zope/lib/python/Shared/DC/ZRDB/DA.py, line 430, in __call__
>     (Object: sqlInsertTest)
>   File /var/zope/Products/ZMySQLDA/db.py, line 191, in query
> KeyError: (see above)
>
>
> I have a hunch that it is trying to interpret the last_insert_id as a python
or
> dtml function or variable, but  I am not experienced enough in zope to know
how
> to debug that.
>
>
>
> On Tue, 18 Apr 2000, you wrote:
> >> I'm running 2.1.4 on a development server.  I haven't bothered testing with
> >> 2.1.6.  What's the key of the KeyError are you getting?
> >> _______________________
> >>
> >> Ron Bickers
> >> Logic Etc, Inc.
> >> rbickers@logicetc.com
> >>
> >>
> >> > -----Original Message-----
> >> > From: Luis Cortes [mailto:lcortes@pollak.com]
> >> > Sent: Tuesday, April 18, 2000 2:17 PM
> >> > To: Ron Bickers
> >> > Subject: RE: [Zope] MySql and Auto_increment
> >> >
> >> >
> >> > Ron,
> >> >
> >> > I am using ZOPE 2.1.6 and the version of MySQL is Ver 9.38
> >> > Distrib 3.22.30,
> >> > for pc-linux-gnu (i686).  I suspect it might actually be a Zope
> >> > issue since I
> >> > can run the inserts and selects fine in MySQL directly.
> >> >
> >> > What version of Zope are you running??
> >> >
> >> > Thanks for the Help,
> >> > Luis.
> >> >
> >> >
> >> >
> >> > On Tue, 18 Apr 2000, you wrote:
> >> > >> Hmmm...
> >> > >>
> >> > >> What is the key from the KeyError?  It says "see above", which
> >> > is in HTML at
> >> > >> the top of the page.
> >> > >>
> >> > >> What version of MySQL and ZMySQLDA are you using?  I'm using
> >> > this technique
> >> > >> in a couple places and it works fine.
> >> >
> --
> ======================================================
>
> Luis Cortes
>
> Pollak EPD (915) 621-6113
>
> ======================================================
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>