[Zope] ZSQL method broken on 2.1.6

Umesh Soni u.soni@cs.ucl.ac.uk
Fri, 09 Jun 2000 16:15:31 +0100


(using zope 2.1.6 with ZMySQLDA-2.0.0a1 and MySQLdb-0.2.1)

Hi there,

I had this ZSQL method (simplified for clarity) working on 2.1.4

select id, nickname  from bboard
where id<=50
order by id desc
limit 30

Now, I've upgraded to 2.1.6 and I get the following error;

Error, _mysql.OperationalError: (1064, "You have an error in your SQL
syntax near 'LIMIT 1000' at line 4") 

-this is wierd because my ZSQL method says "limit 30"


The traceback displayed is;

Traceback (innermost last):
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 214, in publish_module
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 179, in publish
  File /usr/local/Zope/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook
    (Object: simple-test)
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 165, in publish
  File /usr/local/Zope/lib/python/ZPublisher/mapply.py, line 160, in mapply
    (Object: manage_test)
  File /usr/local/Zope/lib/python/ZPublisher/Publish.py, line 102, in call_object
    (Object: manage_test)
  File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 331, in manage_test
    (Object: simple-test)
  File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 312, in manage_test
    (Object: simple-test)
  File /usr/local/Zope/lib/python/Shared/DC/ZRDB/DA.py, line 430, in __call__
    (Object: simple-test)
  File /usr/local/Zope/lib/python/Products/ZMySQLDA/db.py, line 221, in query
OperationalError: (see above)



Note: if I remove the limit constraint as in;

select id, nickname  from bboard
where id<=50
order by id desc

the ZSQL method works fine. I do need to limit the number of results
returned.

Does anyone know a workaround for this?

umesh