You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2017/10/04 15:18:05 UTC
[1/2] incubator-trafodion git commit: [TRAFODION-2762] Allow UPDATE
STATS to create sample tables regardless of CQD
Repository: incubator-trafodion
Updated Branches:
refs/heads/master 431fa830d -> b469d3bb6
[TRAFODION-2762] Allow UPDATE STATS to create sample tables regardless of CQD
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/2f49cda9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/2f49cda9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/2f49cda9
Branch: refs/heads/master
Commit: 2f49cda944da82ff8cc411b324d1000b8b9795d0
Parents: d3a6b6b
Author: Dave Birdsall <db...@apache.org>
Authored: Tue Oct 3 20:38:39 2017 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue Oct 3 20:38:39 2017 +0000
----------------------------------------------------------------------
core/sql/ustat/hs_update.cpp | 37 ++++++++++++++-----------------------
1 file changed, 14 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2f49cda9/core/sql/ustat/hs_update.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_update.cpp b/core/sql/ustat/hs_update.cpp
index b4631ea..b7d48b5 100644
--- a/core/sql/ustat/hs_update.cpp
+++ b/core/sql/ustat/hs_update.cpp
@@ -245,31 +245,22 @@ Lng32 UpdateStats(char *input, NABoolean requestedByCompiler)
// allow select * to return system added columns
retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT MV_ALLOW_SELECT_SYSTEM_ADDED_COLUMNS 'ON'");
HSExitIfError(retcode);
- // the next 2 defaults are used to enable nullable primary and store by
- // keys. If these are enabled, send these 2 cqds to the second mxcmp so
- // the sample table could be created with nullable keys.
- if (CmpCommon::getDefault(ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT) == DF_ON)
- {
- retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT 'ON'");
- HSExitIfError(retcode);
- }
- else
- {
- retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT 'OFF'");
- HSExitIfError(retcode);
- }
+
+ // The next 2 defaults are used to enable nullable primary and store by
+ // keys. We enable them even though the CQDs might be 'OFF' by default,
+ // because the user might have created the table when they were 'ON'.
+ // They would only be needed if we choose to create a sample table; the
+ // sample table would have to be created using the same CQDs. In the future,
+ // perhaps CQDs should be captured at DDL time so that UPDATE STATISTICS
+ // can make use of them when creating sample tables.
+
+ // Allow nullable primary key on a sample table
+ retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT ALLOW_NULLABLE_UNIQUE_KEY_CONSTRAINT 'ON'");
+ HSExitIfError(retcode);
// OFF enables no error on nullable storeby
- if (CmpCommon::getDefault(CAT_ERROR_ON_NOTNULL_STOREBY) == DF_OFF)
- {
- retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT CAT_ERROR_ON_NOTNULL_STOREBY 'OFF'");
- HSExitIfError(retcode);
- }
- else
- {
- retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT CAT_ERROR_ON_NOTNULL_STOREBY 'ON'");
- HSExitIfError(retcode);
- }
+ retcode = HSFuncExecQuery("CONTROL QUERY DEFAULT CAT_ERROR_ON_NOTNULL_STOREBY 'OFF'");
+ HSExitIfError(retcode);
if (CmpCommon::getDefault(WMS_CHILD_QUERY_MONITORING) == DF_OFF)
{
[2/2] incubator-trafodion git commit: Merge [TRAFODION-2762] PR 1255
Fix UPDATE STATS issue with nullable pri keys
Posted by db...@apache.org.
Merge [TRAFODION-2762] PR 1255 Fix UPDATE STATS issue with nullable pri keys
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/b469d3bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/b469d3bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/b469d3bb
Branch: refs/heads/master
Commit: b469d3bb6c35712f20d01d7944d0a6f70b1e2b14
Parents: 431fa83 2f49cda
Author: Dave Birdsall <db...@apache.org>
Authored: Wed Oct 4 15:17:23 2017 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Wed Oct 4 15:17:23 2017 +0000
----------------------------------------------------------------------
core/sql/ustat/hs_update.cpp | 37 ++++++++++++++-----------------------
1 file changed, 14 insertions(+), 23 deletions(-)
----------------------------------------------------------------------