GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/trafodion/pull/1759
[TRAFODION-3237] Fix incorrect PCode optimization
When an interval literal was referenced twice or more in an INSERT/SELECT
in expressions with different INTERVAL types, the PCode optimizer was
incorrectly treating the code to produce the interval literal value as a common
subexpression, so the INSERT/SELECT would insert incorrect values.
This has been fixed. The PCode optimizer common subexpression elimination
logic now checks for commonality in datatype, scale and precision for INTERVAL
conversions.
A test case that demonstrates the problem (with correct behavior with the
fix) has been added to core/TEST038.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/trafodion Trafodion3237
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1759.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1759
----
commit 8b4e533d3082379dc090e7efeefab80741334d00
Author: Dave Birdsall <dbirdsall@...>
Date: 2018-12-10T23:32:00Z
[TRAFODION-3237] Fix incorrect PCode optimization
----
---