.. _version_5.1.4:

=============
Version 5.1.4
=============

Released on 2023-02-01.

.. NOTE::

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

    We recommend that you upgrade to the latest 5.0 release before moving to
    5.1.4.

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

Fixes
=====

- Added validation to reject inner column names containing special whitespace
  characters to avoid invalid schema definitions.

- Fixed an issue that caused the returned column names to be missing the
  subscripts when querying sub-columns of nested object arrays.

- Fixed an issue that caused ``ClassCastException`` when accessing a sub-column
  of a nested object array where the sub-column resolves to a nested array.
  e.g.::

    CREATE TABLE test (
      "a" ARRAY(OBJECT AS (
        "b" ARRAY(OBJECT AS (
          "s" STRING
        )))));
    INSERT INTO test (a) VALUES ([{b=[{s='1'}, {s='2'}, {s='3'}]}]);
    SELECT a['b'] FROM test; // a['b'] is type of array(array(object))

- Fixed an issue in the PostgreSQL wire protocol that would cause
  de-serialization of arrays to fail if they contained unquoted strings
  consisting of more than 2 words.
