.. _version_5.9.7:

=============
Version 5.9.7
=============


Released on 2024-01-21.

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

    We recommend that you upgrade to the latest 5.8 release before moving to
    5.9.7.

    A rolling upgrade from 5.8.x to 5.9.7 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.9.0` release notes for a full list of changes in the
5.9 series.

Fixes
=====

- Fixed an issue that prevented the optimizer from creating a valid execution
  plan for queries involving aliases on the output of a correlated join, leading
  to a ``Couldn't create execution plan from logical plan`` error.

- Fixed an issue that could lead to a ``class java.lang.Double cannot be cast to
  class java.math.BigDecimal`` error when using the ``numeric`` type.

- Fixed an issue that could cause queries to run into a ``NullPointerException``
  if having a query condition like ``(nonPrimaryKey = ? AND primaryKeyPart =
  ?)``

- Fixed an issue that caused ``FILTER`` clauses on non-aggregate window
  functions to be ignored instead of raising an unsupported error.

- Fixed an issue leading to an error when exporting big tables via ``COPY TO``
  to the :ref:`Azure Blob Storage <sql-copy-to-az>`.
  This also has a positive effect on performance.

- Fixed an issue that could prevent the creation of new partitions if data was
  written to a partitioned table during a rolling upgrade and that table had
  setting ``warmer.enabled`` specified before the upgrade.

- Fixed an issue that caused uppercase letters in quoted function names from
  a ``CREATE VIEW`` statement to be converted to lowercases, leading to an
  ``UnsupportedFeatureException`` or a false resolution to a different function
  with the same name but in lowercases.

- Fixed an issue that incorrectly updated ``VERSION`` settings from
  :ref:`information_schema.tables <information_schema_tables>` and
  :ref:`information_schema.table_partitions <is_table_partitions>` for
  partitioned tables and their new partitions to the latest version following a
  node upgrade. The fix can't fully repair incorrectly updated versions but
  includes mitigation logic that infers the version based on existing partitions.

- Fixed an issue that caused new partitions' versions created to follow the
  table's version instead of the minimum node version of the cluster.

- Fixed an issue that caused an error when running a distributed query with a
  window function on a virtual table, partitioned by a sub-column that is not
  explicitly selected from the virtual table. Example::

    SELECT ROW_NUMBER() OVER (
         PARTITION BY obj ['a']
    ) AS RK
    FROM (
        SELECT obj
        FROM test
    ) t;

- Fixed an issue which could lead to OutOfMemory errors when requesting large
  result sets over the PostgreSQL protocol.
