GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/trafodion/pull/1660
[TRAFODION-3158] Make EncodedValue error handling more robust
This pull request makes two code changes to function
EncodedValue::constructorFunction.
1. Formerly, the function would check for the existence of an error in
CmpCommon::diags() and remove it if present. This wasn't sufficient though as
the test case in the JIRA generated *two* errors in CmpCommon::diags(); the
code as it was removed only one of them. The result was that the Normalizer
retried the query, and the warnings concerning the bad histogram values were
lost.
2. In my initial attempt to fix this problem, I put an unguarded call to
CmpCommon::diags()->mark() to capture the state of CmpCommon::diags() on entry
to EncodedValue::constructorFunction. This turned out to cause cores in the
mxssmp process at sqstart time, because in that process it happened that the
EncodedValue constructor for a global object was called before the global
CmpCommon::diags() was initialized. This could have happened in any process;
it's just the luck of the draw in what order the linker decides to invoke
global constructors. So to fix that problem, I was forced to add a flag so that
code paths involving global objects do not try to dereference
CmpCommon::diags(). This change is to my mind ugly; I added extensive comments
explaining the situation. Some significant refactoring will be required to
produce a more elegant solution.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/trafodion Trafodion3158
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1660.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 #1660
----
commit 64e5ed11a2d1deae8d748d7d749abb5007ae0c41
Author: Dave Birdsall <dbirdsall@...>
Date: 2018-07-23T17:24:57Z
[TRAFODION-3158] Make EncodedValue error handling more robust
----
---