You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by an...@apache.org on 2016/06/23 20:06:40 UTC
[2/3] incubator-trafodion git commit: change to validate hardcoded
nadefault values
change to validate hardcoded nadefault values
Values specified in hardcoded defaultDefaults array were not
being validated. As a result, some invalid values were being
set up. All values have been corrected and a validation step
for hardcoded defaults has been added. This is done during initial
set up.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/81c2d6e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/81c2d6e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/81c2d6e8
Branch: refs/heads/master
Commit: 81c2d6e8e4604440c946bb5b991b2bb94291fe83
Parents: 392c608
Author: Anoop Sharma <an...@esgyn.com>
Authored: Thu Jun 23 16:48:06 2016 +0000
Committer: Anoop Sharma <an...@esgyn.com>
Committed: Thu Jun 23 16:48:06 2016 +0000
----------------------------------------------------------------------
core/sql/bin/SqlciErrors.txt | 2 +-
core/sql/sqlcomp/nadefaults.cpp | 52 ++++++++++++++++++------------------
2 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/81c2d6e8/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 7781d6c..2be1bc5 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -593,7 +593,7 @@
2076 21000 99999 BEGINNER MAJOR DBADMIN HIST_NO_STATS_UEC should always be less than or equal to CQD HIST_NO_STATS_ROWCOUNT. Present Value of HIST_NO_STATS_ROWCOUNT is $0~string0.
2077 ZZZZZ 99999 BEGINNER MINOR DBADMIN The max size $0~int0 must be greater than the initial size $1~int1.
2078 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Assertion failure during semantic query optimization ($0~string0) in file $1~string1 at line $2~int0. Attempting to recover and produce a plan.
-2079 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error occurred during initialization of NADefaults structure. Make sure that default constants specified in enum DefaultConstants are set up correctly in defaultDefaults[] array.
+2079 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error occurred during initialization of NADefaults structure. Make sure that default constants specified in enum DefaultConstants are specified in defaultDefaults[] array, are in alphabetical order and the default values are valid.
2080 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $3~int2 while reading file: $2~int1 bytes were read from $0~string0 when $1~int0 were expected in module $4~string1.
2081 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $1~int0 while opening file $0~string0 for read.
2082 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error $1~int0 while opening file $0~string0 for write.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/81c2d6e8/core/sql/sqlcomp/nadefaults.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp
index 7b139cd..7301575 100644
--- a/core/sql/sqlcomp/nadefaults.cpp
+++ b/core/sql/sqlcomp/nadefaults.cpp
@@ -575,7 +575,7 @@ SDDkwd__(CAT_ENABLE_QUERY_INVALIDATION, "ON"),
// This forces an rcb to be created with a different version number
// A "0" means to take the current mxv version
- DDui1__(CAT_RCB_VERSION, "0"),
+ DDui___(CAT_RCB_VERSION, "0"),
// Controls creation of column privileges for object-level privileges
DDkwd__(CAT_REDUNDANT_COLUMN_PRIVS, "ON"),
@@ -1367,7 +1367,7 @@ SDDkwd__(EXE_DIAGNOSTIC_EVENTS, "OFF"),
DDkwd__(EXPAND_DP2_SHORT_ROWS, "ON"),
- XDDui___(EXPLAIN_DESCRIPTION_COLUMN_SIZE, "-1"),
+ XDDint__(EXPLAIN_DESCRIPTION_COLUMN_SIZE, "-1"),
DDkwd__(EXPLAIN_DETAIL_COST_FOR_CALIBRATION, "FALSE"),
@@ -2432,7 +2432,7 @@ SDDkwd__(ISO_MAPPING, (char *)SQLCHARSETSTRING_ISO88591),
DDkwd__(MVQR_USE_RI_FOR_EXTRA_HUB_TABLES, "OFF"),
DD_____(MVQR_WORKLOAD_ANALYSIS_MV_NAME, ""),
- XDDMVA__(MV_AGE, ""),
+ XDDMVA__(MV_AGE, "0 MINUTES"),
XDDkwd__(MV_ALLOW_SELECT_SYSTEM_ADDED_COLUMNS, "OFF"),
DDkwd__(MV_AS_ROW_TRIGGER, "OFF"),
DDkwd__(MV_AUTOMATIC_LOGGABLE_COLUMN_MAINTENANCE, "ON"),
@@ -3549,7 +3549,7 @@ XDDkwd__(SUBQUERY_UNNESTING, "ON"),
DDui___(USTAT_IUS_MAX_PERSISTENT_DATA_IN_MB, "50000"), // 50GB
DDflt0_(USTAT_IUS_MAX_PERSISTENT_DATA_IN_PERCENTAGE, "0.20"), // 20% of the total
- DDui1_6(USTAT_IUS_MAX_TRANSACTION_DURATION, "20"), // in minutes
+ DDui1_6(USTAT_IUS_MAX_TRANSACTION_DURATION, "5"), // in minutes
DDkwd__(USTAT_IUS_NO_BLOCK, "OFF"),
DDansi_(USTAT_IUS_PERSISTENT_CBF_PATH, "SYSTEM"),
@@ -3916,10 +3916,26 @@ void NADefaults::initCurrentDefaultsWithDefaultDefaults()
}
prevAttrName = defaultDefaults[i].attrName;
+ // validate initial default default values
+ CMPASSERT(defaultDefaults[i].validator);
+ if (! defaultDefaults[i].validator->validate(
+ defaultDefaults[i].value,
+ this,
+ defaultDefaults[i].attrEnum,
+ +1/*warning*/))
+ {
+ SqlParser_NADefaults_ = NULL;
+
+ cerr << "\nERROR: " << defaultDefaults[i].attrName
+ << " has invalid value" << defaultDefaults[i].value << endl;
+
+ return;
+ }
+
// LCOV_EXCL_START
// for debugging only
#ifndef NDEBUG
- if (nadval) { // additional sanity checking we want to do occasionally
+ if (nadval) { // additional sanity checking we want to do occasionally
NAString v;
@@ -3978,8 +3994,8 @@ void NADefaults::initCurrentDefaultsWithDefaultDefaults()
CMPASSERT(v == keywords_[j]);
CMPASSERT(v.first(' ') == NA_NPOS);
- }
+ }
} // if env-var
#endif // NDEBUG
// LCOV_EXCL_STOP
@@ -6783,16 +6799,8 @@ DefaultToken NADefaults::token(Int32 attrEnum,
// sent using sendAllControls method, all values are valid. This will
// ensure that if this default is not set and is sent over to secondary
// mxcmp using an internal CQD statement, it doesn't return an error.
- if (cmpCurrentContext->isSecondaryMxcmp())
- {
- if (tok == DF_ON || tok == DF_OFF)
- isValid = TRUE;
- }
- else
- {
- if (tok == DF_ON)
- isValid = TRUE;
- }
+ if (tok == DF_ON || tok == DF_OFF)
+ isValid = TRUE;
break;
case NVCI_PROCESS:
@@ -6804,16 +6812,8 @@ DefaultToken NADefaults::token(Int32 attrEnum,
// sent using sendAllControls method, all values are valid. This will
// ensure that if this default is not set and is sent over to secondary
// mxcmp using an internal CQD statement, it doesn't return an error.
- if (cmpCurrentContext->isSecondaryMxcmp())
- {
- if (tok == DF_ON || tok == DF_OFF)
- isValid = TRUE;
- }
- else
- {
- if (tok == DF_ON)
- isValid = TRUE;
- }
+ if (tok == DF_ON || tok == DF_OFF)
+ isValid = TRUE;
break;
case NAMETYPE: