Filter conditions may be evaluated in a in order which raises an exception
Details
| Detail name | Value |
|---|---|
| Changelog Number | 14547 |
| Type | Bug |
| Status | Open |
| Affected Versions | Exasol 7.0.0, Exasol 7.1.0, Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2025.2.0 |
Background
The SQL Standard does not specify any order for the evaluation of filter conditions.
Description
In some cases, a filter condition requires another filter condition to be applied first in order not to raise an exception.
Examples
b > 0 --has be be evaluated before a/b = c
or
is_date(e) --has be be evaluated before to_date(e) = d
Workaround
Remove the dependency of the filters by protecting the affected filter conditions.
e.g.
--use case when b <> 0 then a/b end = c --instead of a/b = c
or
--use case when is_date(e) then to_date(e) end = d --instead of to_date(e) = d
Fix
Filter conditions are evaluated in an order that does not raise avoidable exceptions.