GitHub user DaveBirdsall opened a pull request:
https://github.com/apache/incubator-trafodion/pull/499
[TRAFODION-2004] UPDATE STATS not supported on volatile tables
UPDATE STATISTICS currently does not work on volatile tables in Trafodion.
Before this change, it gave confusing and varying error messages when invoked
on a volatile table. This code change will cause UPDATE STATISTICS to put out
error 9247 "UPDATE STATISTICS is not supported on volatile tables presently"
instead.
Ironically, to get this error message to come out in all the right
contexts, there were two bugs in CQD logic that needed to be addressed. It is
ironic, because we'd have to fix these bugs to make UPDATE STATISTICS work for
volatile tables. So, we've taken a small step toward that goal with these
changes.
The bugs were in the CQD HOLD and CQD RESTORE mechanism. CQD HOLD
essentially allows one to push the current value of a CQD in preparation for
setting a different value temporarily. CQD RESTORE pops that value. The first
bug was that the current logic implemented a stack of depth one, however there
are code paths in Trafodion that do two CQD HOLDs, then two CQD RESTOREs. This
caused a stack overflow; the original value going in the bit bucket. The fix
was to essentially implement a stack of depth two. The second bug was that CQD
RESTORE would only update the currentDefaults_ array in nadefaults.cpp. It
failed to update other cached information such as currentTokens_, nor did it
perform the semantic actions associated with particular CQDs. The result was
that sometimes the CQD didn't really get restored. The fix was to do the normal
semantic processing of a CQD at RESTORE time, instead of simply setting
currentDefaults_.
These two bugs manifested in UPDATE STATISTICS by giving it an inaccurate
impression of when a volatile schema was active. Sometimes UPDATE STATISTICS
would think that no volatile schema was in use when in fact one was. Thus, an
incorrect error message would be issued in that case if attempting UPDATE
STATISTICS on a volatile table.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/DaveBirdsall/incubator-trafodion Trafodion2004
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-trafodion/pull/499.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 #499
----
commit d7f38915584d7a96fbf1cf65016caab8602fb455
Author: Dave Birdsall <[email protected]>
Date: 2016-05-24T22:31:13Z
[TRAFODION-2004] UPDATE STATS not supported on volatile tables
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---