Add basic type deduction for null in tuples

Details

Detail name Value
Changelog Number 9091
Type Improvement
Status Resolved
Fix Versions Exasol 6.2.3
Resolution Date 2019-11-27

Problem

Up to version 6.2.3, Exasol assumes that the type of NULL in tuples is BOOLEAN. This can cause type errors.

Example:

SELECT * FROM VALUES ((1, TRUE), (NULL, FALSE)) AS t(i, b);

Workaround

It is possible to cast NULL to the desired data type.
Example:

SELECT * FROM VALUES ((1, TRUE), (CAST(NULL AS CHAR(1)), FALSE)) AS t(i, b);

Starting with 6.2.3, Exasol uses type deduction for NULLs. Thus, in 6.2.3 such queries not require casts around NULL as long as there is a constant in one of the tuples. If there are only expressions in the tuples (besides NULL), Exasol still requires casts in 6.2.3.