mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Previously, CaseProcessor was pre-calculating (called `process()`) on all the building elements of a CASE/IIF expression, not only the conditions involved but also the results, as well as the final else result. In case one of those results had an erroneous calculation (e.g.: division by zero) this was executed and resulted in an Exception to be thrown, even if this result was not used because of the condition guarding it. e.g.: ``` SELECT CASE myField1 = 0 THEN NULL ELSE myField2 / myField1 END FROM test; ``` Fixes: #49388 (cherry picked from commit dbd169afc98686cae1bc72024fad0ca32b272efd)