.. _version_5.5.1:

=============
Version 5.5.1
=============

Released on 2023-11-30.

.. NOTE::

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

    We recommend that you upgrade to the latest 5.4 release before moving to
    5.5.1.

    A rolling upgrade from 5.4.x to 5.5.1 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.5.0` release notes for a full list of changes in the
5.5 series.


Fixes
=====

- Fixed an issue that caused queries with a ``NOT`` expression in the
  ``WHERE`` clause to fail evaluating ``NULL`` correctly.

- Fixed an issue that caused the value for generated primary key columns to
  evaluate to ``NULL`` in ``INSERT INTO .. ON CONFLICT`` statements if the
  column wasn't part of the target column list.

- Creating a table that uses a table-function as part of a default expression or
  generated expression now results in an error on table creation, instead of
  never inserting records due to runtime failures.

- Improved the error message when using ``COPY FROM`` with
  ``wait_for_completion=false`` and ``RETURN SUMMARY``. It now reports that the
  combination is not supported instead of running into a ``ClassCastException``.

- Fixed an issue that caused queries with a ``NOT (a AND b)`` expression
  in the ``WHERE`` clause to not evaluate correctly with ``NULL`` values.

- Fixed an issue that caused queries with a ``NOT`` or ``!=`` on a ``CASE``
  expression containing a nullable column to exclude ``NULL`` entries.

- Re-added ``jcmd`` to the bundled JDK distribution.

- Return meaningful error when trying to drop a column which itself or its
  sub-columns participates in a
  :ref:`table level constraint with other columns <check_constraint_multiple_cols>`.
  For example, we  cannot drop column ``col_to_drop`` from the following
  tables::

    CREATE TABLE t1 (i int, col_to_drop int,
                     CHECK (col_to_drop + i > 0))
    CREATE TABLE t2 (i int, col_to_drop object AS (subcol_a int),
                     CHECK (col_to_drop['subcol_a'] + i > 0))

- Fixed an issue that caused a ``ColumnUnknownException`` to be thrown when
  attempting to drop a column with a :ref:`check_constraint`. All relevant
  constraints are dropped together with the column.

- Fixed an issue that caused the hash-join operator generate invalid hashes which
  lead to a broken join operation when there were more than two relations
  involved e.g.::

    SELECT * FROM t1, t2, t3 WHERE t3.c = t1.a AND t3.c = t2.b AND t1.a = t2.b;

  would generate the logical plan::

    HashJoin[(t3.c = t2.b AND t1.a = t2.b)]
      ├ HashJoin[(t3.c = t1.a)]
      │  ├ Collect[doc.t3 | [c] | true]
      │  └ Collect[doc.t1 | [a] | true]
      └ Collect[doc.t2 | [b] | true]

  The hash-symbol generation for the join `t3.c = t2.b AND t1.a = t2.b` was
  broken and would not join the data.

- Fixed a regression introduced in 5.5.0 that caused the loss of filter
  conditions in nested-joins when the query was optimized by the rule
  ``optimizer_move_filter_beneath_join``.

- Fixed a regression introduced in 5.5.0 that caused empty string to be
  accepted as a valid column name while table creation.
