Relstorage

Latest version: v4.1.1

Safety actively analyzes 701671 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 14

3.0a3

Not secure
==================

- Zapping a storage now also removes any persistent cache files. See
:issue:`241`.

- Zapping a MySQL storage now issues ``DROP TABLE`` statements instead
of ``DELETE FROM`` statements. This is much faster on large
databases. See :issue:`242`.

- Workaround the PyPy 7.1 JIT bug using MySQL Connector/Python. It is no
longer necessary to disable the JIT in PyPy 7.1.

- On PostgreSQL, use PostgreSQL's efficient binary ``COPY FROM`` to
store objects into the database. This can be 20-40% faster. See
:issue:`247`.

- Use more efficient mechanisms to poll the database for current TIDs
when verifying serials in transactions.

- Silence a warning about ``cursor.connection`` from pg8000. See
:issue:`238`.

- Poll the database for the correct TIDs of older transactions when
loading from a persistent cache, and only use the entries if they
are current. This restores the functionality lost in the fix for
:issue:`249`.

- Increase the default cache delta limit sizes.

- Fix a race condition accessing non-shared blobs when the blob cache
limit was reached which could result in blobs appearing to be
spuriously empty. This was only observed on macOS. See :issue:`219`.

- Fix a bug computing the cache delta maps when restoring from
persistent cache that could cause data from a single transaction to
be stale, leading to spurious conflicts.

3.0a2

Not secure
==================

- Drop support for PostgreSQL versions earlier than 9.6. See
:issue:`220`.

- Make MySQL and PostgreSQL use a prepared statement to get
transaction IDs. PostgreSQL also uses a prepared statement to set
them. This can be slightly faster. See :issue:`246`.

- Make PostgreSQL use a prepared statement to move objects to their
final destination during commit (history free only). See
:issue:`246`.

- Fix an issue with persistent caches written to from multiple
instances sometimes getting stale data after a restart. Note: This
makes the persistent cache less useful for objects that rarely
change in a database that features other actively changing objects;
it is hoped this can be addressed in the future. See :issue:`249`.

3.0a1

Not secure
==================

- Add support for Python 3.7.

- Drop support for Python 3.4.

- Drop support for Python 2.7.8 and earlier.

- Drop support for ZODB 4 and ZEO 4.

- Officially drop support for versions of MySQL before 5.7.9. We haven't
been testing on anything older than that for some time, and older
than 5.6 for some time before that.

- Drop the ``poll_interval`` parameter. It has been deprecated with a
warning and ignored since 2.0.0b2. See :issue:`222`.

- Drop support for pg8000 older than 1.11.0.

- Drop support for MySQL Connector/Python older than 8.0.16. Many
older versions are known to be broken. Note that the C extension,
while available, is not currently recommended due to internal
errors. See :issue:`228`.

- Test support for MySQL Connector/Python on PyPy. See :issue:`228`.

.. caution:: Prior to PyPy 7.2 or RelStorage 3.0a3, it is necessary to disable JIT
inlining due to `a PyPy bug
<https://bitbucket.org/pypy/pypy/issues/3014/jit-issue-inlining-structunpack-hh>`_
with ``struct.unpack``.

- Drop support for PyPy older than 5.3.1.

- Drop support for the "MySQL Connector/Python" driver name since it
wasn't possible to know if it would use the C extension or the
Python implementation. Instead, explicitly use the 'Py' or 'C'
prefixed name. See :pr:`229`.

- Drop the internal and undocumented environment variables that could be
used to force configurations that did not specify a database driver
to use a specific driver. Instead, list the driver in the database
configuration.

- Opening a RelStorage configuration object read from ZConfig more
than once would lose the database driver setting, reverting to
'auto'. It now retains the setting. See :issue:`231`.

- Fix Python 3 with mysqlclient 1.4. See :issue:`213`.

- Drop support for mysqlclient < 1.4.

- Make driver names in RelStorage configurations case-insensitive
(e.g., 'MySQLdb' and 'mysqldb' are both valid). See :issue:`227`.

- Rename the column ``transaction.empty`` to ``transaction.is_empty``
for compatibility with MySQL 8.0, where ``empty`` is now a reserved
word. The migration will happen automatically when a storage is
first opened, unless it is configured not to create the schema.

.. note:: This migration has not been tested for Oracle.

.. note:: You must run this migration *before* attempting to upgrade
a MySQL 5 database to MySQL 8. If you cannot run the
upgrade through opening the storage, the statement is
``ALTER TABLE transaction CHANGE empty is_empty BOOLEAN
NOT NULL DEFAULT FALSE``.

- Stop getting a warning about invalid optimizer syntax when packing a
MySQL database (especially with the PyMySQL driver). See
:issue:`163`.

- Add ``gevent MySQLdb``, a new driver that cooperates with gevent
while still using the C extensions of ``mysqlclient`` to communicate
with MySQL. This is now recommended over ``umysqldb``, which is
deprecated and will be removed.

- Rewrite the persistent cache implementation. It now is likely to
produce much higher hit rates (100% on some benchmarks, compared to
1-2% before). It is currently slower to read and write, however.
This is a work in progress. See :pr:`243`.

- Add more aggressive validation and, when possible, corrections for
certain types of cache consistency errors. Previously an
``AssertionError`` would be raised with the message "Detected an
inconsistency between RelStorage and the database...". We now
proactively try harder to avoid that situation based on some
educated guesses about when it could happen, and should it still
happen we now reset the cache and raise a type of ``TransientError``
allowing the application to retry. A few instances where previously
incorrect data could be cached may now raise such a
``TransientError``. See :pr:`245`.

2.1.1

Not secure
==================

- Avoid deleting attributes of DB driver modules we import. Fixes
:issue:`206` reported by Josh Zuech.

2.1.0

Not secure
==================

- Document that installing RelStorage from source requires a working
CFFI compilation environment. Fixes :issue:`187`, reported by
Johannes Raggam.

- Test with MySQL Connector/Python 8.0.6, up from 2.1.5. Note that
PyPy 5.8.0 is known to *not* work with MySQL Connector/Python
(although PyPy 5.6.0 did).

2.1a2

Not secure
==================

- Implemented the storage ``afterCompletion`` method, which allows
RelStorage storages to be notified of transaction endings for
transactions that don't call the two-phase commit API. This allows
resources to be used more efficiently because it prevents RDBMS
transactions from being held open.

Fixes: :issue:`147` (At least for ZODB 5.2.)

- Oracle: Fix two queries that got broken due to the performance work
in 2.1a1.

- MySQL: Workaround a rare issue that could lead to a ``TypeError``
when getting new OIDs. See :issue:`173`.

- The ``len`` of a RelStorage instance now correctly reflects the
approximate number of objects in the database. Previously it
returned a hardcoded 0. See :issue:`178`.

- MySQL: Writing blobs to the database is much faster and scales much
better as more blobs are stored. The query has been rewritten to use
existing primary key indexes, whereas before it used a table scan
due to deficiencies in the MySQL query optimizer. Thanks to Josh
Zuech and enfold-josh. See :issue:`175`.

Page 8 of 14

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.