Mod_python error: "PythonHandler invenio.webinterface_layout"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/usr/local/lib/python2.4/site-packages/invenio/webinterface_handler.py", line 231, in _handler
    return root._traverse(req, path)

  File "/usr/local/lib/python2.4/site-packages/invenio/webinterface_handler.py", line 191, in _traverse
    result = obj(req, form)

  File "/usr/local/lib/python2.4/site-packages/invenio/websearch_webinterface.py", line 112, in __call__
    out = search_engine.perform_request_search(req, **argd)

  File "/usr/local/lib/python2.4/site-packages/invenio/search_engine.py", line 3081, in perform_request_search
    print_records(req, range(recid, recidb), -1, -9999, of, ot, ln, search_pattern=p)

  File "/usr/local/lib/python2.4/site-packages/invenio/search_engine.py", line 2379, in print_records
    temp = {

  File "/usr/local/lib/python2.4/site-packages/invenio/search_engine.py", line 2728, in print_record
    res = run_sql(query)

  File "/usr/local/lib/python2.4/site-packages/invenio/dbquery.py", line 54, in run_sql
    rc = cur.execute(sql, param)

  File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 166, in execute

  File "build/bdist.linux-i686/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler

ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'A=0'' at line 1")