.. _version_2.0.6:

=============
Version 2.0.6
=============

Released on 2017/07/19.

.. NOTE::

    If you are upgrading a cluster, you must be running CrateDB
    :ref:`version_1.1.3` or higher before you upgrade to 2.0.6.

    If you want to perform a `rolling upgrade`_, your current CrateDB version
    number must be :ref:`version_2.0.0`.  If you want to upgrade from a version
    prior to this, the upgrade will introduce all of the breaking changes
    listed for :ref:`version_2.0.0`, and will require a `full restart
    upgrade`_.

    Consult the upgrade notes for :ref:`Version 2.0.0
    <version_2.0.0_upgrade_notes>` when upgrading.

.. WARNING::

    If you're using CrateDB's BLOB storage you should consult the `Upgrade
    Notes`_.

    Before upgrading, you should `back up your data`_.

.. _rolling upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/rolling-upgrade.html
.. _full restart upgrade: https://crate.io/docs/crate/howtos/en/latest/admin/full-restart-upgrade.html
.. _back up your data: https://crate.io/docs/crate/reference/en/latest/admin/snapshots.html

.. rubric:: Table of contents

.. contents::
   :local:


Upgrade Notes
=============

Due to a bug introduced in :ref:`version_2.0.0` that can cause loss of BLOB
data, it is necessary to perform a `rolling upgrade`_ if you're running a
version >= 2.0.0 and < 2.0.4 and using BLOB tables.

Additionally, the number of replicas needs to be set to at least ``1`` for
*all* blob tables and you need to make sure that data is fully replicated
before continuing.

Only then you may upgrade one node after each other.


Changelog
=========


Fixes
-----

- Allow ``GROUP BY`` on any :ref:`scalar functions <scalar-functions>`, e.g.::

    SELECT id + 1 FROM t GROUP BY id

- Added support for conditionals with ``NULL`` arguments.

- Do not include Lucene indices (metadata) of ``BLOB`` tables in snapshot when
  using ``CREATE SNAPSHOT`` with ``ALL``, because the actual binary files of
  ``BLOB`` tables cannot be backed up using ``SNAPSHOT/RESTORE``
  functionality.

- Fixed rename table operation for empty partitioned tables.

- Fixed an issue which resulted in an exception when using the same global
  aggregation symbol twice as a select item on a join query.

- Fixed an issue that caused wrong results to be returned for global
  aggregation on ``JOINS`` when :ref:`literal expression <sql-literal-value>`
  in ``WHERE`` clause is :ref:`evaluated <gloss-evaluation>` to false, e.g.::

    SELECT COUNT(*) FROM t1, t2 WHERE 1=2

- Provide comprehensive error message when using a ``NULL`` literal in ``GROUP
  BY``.

- Allow ``DISTINCT`` to operate on literals, e.g.::

    SELECT DISTINCT ['val1', 'val2'], col1, col2, ... FROM t

- Allow ``GROUP BY`` on any literal, e.g.::

    SELECT {a=1, b=2}, COUNT(*) FROM t GROUP BY 1

- Fixed an issue that can hang the nodes when running an insert from query
  statement for a large dataset when the target table is an empty partitioned
  table.

- Fixed a race condition which could cause ``UPDATE`` or ``DELETE`` statements
  to get stuck.

- Fixed a ClassCastException that could occur on certain queries if connected
  via the PostgreSQL protocol.

- Fixed an issue that could cause the ``_score >= <minScore>`` filter to not
  work correctly if used in a query with an ``ORDER BY`` clause.
