Comment 5 for bug 143917

Revision history for this message
Tres Seaver (tseaver) wrote :

The attached module has a Results class which provides a much stripped-down
form of the one in Shared.DC.ZRDB.Results. In particular:

 - It doesn't alias column names (the source of the memory leak).

 - It provides much more efficient mapping of a row index into a
   dictionary keyed by column name.

It loses a bunch of seldom used features of the original class (methods not
implemented).

To deal with the weird calling convention Shared.DC.ZRDB.DA uses to create
results, it contains a factory function, 'makeZRDBResults', which expects
to be passed a single tuple, (items, data).

You should be able to monkey-patch this factory in via something like::

  import Shared.DC.ZRDB.Connection
  Shared.DC.ZRDB.Connection.Results = makeZRDBResults
  import Shared.DC.ZRDB.DA
  Shared.DC.ZRDB.DA.Results = makeZRDBResults