diff --git a/dbcon/execplan/treenode.h b/dbcon/execplan/treenode.h index d246fae53..1f1166fa3 100644 --- a/dbcon/execplan/treenode.h +++ b/dbcon/execplan/treenode.h @@ -39,7 +39,6 @@ #include "calpontsystemcatalog.h" #include "exceptclasses.h" #include "dataconvert.h" - namespace messageqcpp { class ByteStream; } @@ -483,8 +482,24 @@ inline const std::string& TreeNode::getStrVal() } else { - snprintf(tmp, 312, "%e", fResult.floatVal); - fResult.strVal = tmp; + // MCOL-299 Print scientific with 5 mantissa and no + sign for exponent + int exponent = (int)floor(log10( fabs(fResult.floatVal))); // This will round down the exponent + double base = fResult.floatVal * pow(10, -1.0*exponent); + if (isnan(exponent) || isnan(base)) + { + snprintf(tmp, 312, "%f", fResult.floatVal); + fResult.strVal = removeTrailing0(tmp, 312); + } + else + { + snprintf(tmp, 312, "%.5f", base); + fResult.strVal = removeTrailing0(tmp, 312); + snprintf(tmp, 312, "e%02d", exponent); + fResult.strVal += tmp; + } + +// snprintf(tmp, 312, "%e.5", fResult.floatVal); +// fResult.strVal = tmp; } break; } @@ -499,8 +514,23 @@ inline const std::string& TreeNode::getStrVal() } else { - snprintf(tmp, 312, "%e", fResult.doubleVal); - fResult.strVal = tmp; + // MCOL-299 Print scientific with 9 mantissa and no + sign for exponent + int exponent = (int)floor(log10( fabs(fResult.doubleVal))); // This will round down the exponent + double base = fResult.doubleVal * pow(10, -1.0*exponent); + if (isnan(exponent) || isnan(base)) + { + snprintf(tmp, 312, "%f", fResult.doubleVal); + fResult.strVal = removeTrailing0(tmp, 312); + } + else + { + snprintf(tmp, 312, "%.9f", base); + fResult.strVal = removeTrailing0(tmp, 312); + snprintf(tmp, 312, "e%02d", exponent); + fResult.strVal += tmp; + } +// snprintf(tmp, 312, "%e", fResult.doubleVal); +// fResult.strVal = tmp; } break; } diff --git a/procmon/main.cpp b/procmon/main.cpp index 3a1942c50..36e6ab98d 100644 --- a/procmon/main.cpp +++ b/procmon/main.cpp @@ -2326,7 +2326,7 @@ void processStatusMSG(messageqcpp::IOSocket* cfIos) log.writeLog(__LINE__, "statusControl: Set Process " + moduleName + "/" + processName + + " State = " + oamState[state] + " PID = " + oam.itoa(PID), LOG_TYPE_DEBUG); //update table - if ( state < STATE_MAX ) + if ( state < PID_UPDATE ) fShmProcessStatus[shmIndex].ProcessOpState = state; if ( PID != 1 ) fShmProcessStatus[shmIndex].ProcessID = PID; diff --git a/utils/funcexp/func_div.cpp b/utils/funcexp/func_div.cpp index 676b5a824..d75942b6d 100644 --- a/utils/funcexp/func_div.cpp +++ b/utils/funcexp/func_div.cpp @@ -24,6 +24,8 @@ #include #include #include +#define __STDC_LIMIT_MACROS +#include using namespace std; #include "functor_real.h" @@ -56,6 +58,12 @@ int64_t Func_div::getIntVal(rowgroup::Row& row, return 0; } int64_t int_val1 = (int64_t)(val1 > 0 ? val1 + 0.5 : val1 - 0.5); + // MCOL-176 If abs(int_val2) is small enough (like -1), then, this may cause overflow. + // This kludge stops the crash. + if (int_val1 == INT64_MIN) + { + --int_val1; + } return int_val1 / int_val2; } diff --git a/utils/joiner/joiner.vpj b/utils/joiner/joiner.vpj index 65df93f5a..8de9d375f 100644 --- a/utils/joiner/joiner.vpj +++ b/utils/joiner/joiner.vpj @@ -1,228 +1,230 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Version="10.0" + VendorName="SlickEdit" + TemplateName="GNU C/C++" + WorkingDir="."> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/utils/utils.vpj b/utils/utils.vpj index 52badc5cc..342be0482 100644 --- a/utils/utils.vpj +++ b/utils/utils.vpj @@ -1,243 +1,295 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Version="10.0" + VendorName="SlickEdit" + TemplateName="GNU C/C++" + WorkingDir="."> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +