.. _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 :ref:`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
   :ref:`full_restart_upgrade`.

   Consult the :ref:`version_2.0.0_upgrade_notes` for ``2.0.0`` when upgrading.

.. WARNING::

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

.. WARNING::

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

.. _back up your data: https://crate.io/a/backing-up-and-restoring-crate/

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 :ref:`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 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 literal expression in ``WHERE`` clause is
   evaluated 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 postgres 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.
