.. _version_5.0.2:

=============
Version 5.0.2
=============

Released on 2022-10-10.

.. NOTE::

    If you are upgrading a cluster, you must be running CrateDB 4.0.2 or higher
    before you upgrade to 5.0.2.

    We recommend that you upgrade to the latest 4.8 release before moving to
    5.0.2.

    A rolling upgrade from 4.8.x to 5.0.2 is supported.
    Before upgrading, you should `back up your data`_.

.. WARNING::

    Tables that were created before CrateDB 4.x will not function with 5.x
    and must be recreated before moving to 5.x.x.

    You can recreate tables using ``COPY TO`` and ``COPY FROM`` or by
    `inserting the data into a new table`_.

.. _back up your data: https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html
.. _inserting the data into a new table: https://crate.io/docs/crate/reference/en/latest/admin/system-information.html#tables-need-to-be-recreated



.. rubric:: Table of Contents

.. contents::
   :local:

See the :ref:`version_5.0.0` release notes for a full list of changes in the
5.0 series.

Fixes
=====

- Fixed an issue causing queries with matching on ``_id`` to not get rows
  from :ref:`translog <concept-addressing-documents>`, and therefore only
  rows that were visible from the latest manual or automatic
  :ref:`REFRESH <sql-refresh>` were returned.

- Fixed an issue causing an ``IllegalArgumentException`` to be thrown when the
  optimizer attempts to convert a ``LEFT JOIN`` to an ``INNER JOIN`` and there
  is also a subquery in the ``WHERE`` clause.

- Fixed a file descriptor leak that was triggered by querying the ``os`` column
  of the ``sys.nodes`` table.

- Fixed an issue that could lead to a ``NoSuchElementException`` when using the
  JDBC client and mixing different DML statements using the ``addBatch``
  functionality.

- Fixed an issue that could lead to stuck queries.

- Fixed ``EXPLAIN`` plan output for queries with a ``WHERE`` clause containing
  implicit cast symbols. A possible optimization of our planner/optimizer was
  not used, resulting in different output than actually used on plan execution.

- Fixed an issue that leads to stuck write queries if the
  :ref:`indices.breaker.query.limit` is set to ``-1`` as the value was
  interpreted as a byte value instead of disabling any breaking.
