[Zope] Weird SQL Relay conversion error in Zope

Dieter Maurer dieter at handshake.de
Fri May 16 15:59:08 EDT 2008

Mike Driscoll wrote at 2008-5-9 08:31 -0500:
> ...
>I am working on a web app that interfaces with Microsoft SQL Server from Ubuntu through SQL Relay. I will be getting data from multiple databases. The issue seems to be that either Zope or SQL Relay cannot handle the Decimal type if the value is a null. If I do a query like this:
> ...
>    * Module Products.ZSQLRelayDA.db, line 86, in query
>    * Module decimal, line 571, in __new__
>    * Module decimal, line 2267, in _raise_error
>InvalidOperation: (Also, the following error occurred while attempting to render the standard error message, please see the event log for full details: '@@plone')

Looks like a bug in "ZSQLRelayDA.db".

  Apparently, it passes SQL decimal values to Python's "decimal" module --
  even if the SQL value is "Null" (almost surely mapped to Python's "None").
  For obvious reasons, "decimal" does not like to convert "None"
  into a "decimal" value.

  "ZSQLRelayDA.db" should test for "None" and call the "decimal"
  constructor only for non "None" values.


More information about the Zope mailing list