From e47eaae0334a0c3fd4569d008d4e229450279ac0 Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 6 Jul 2020 12:47:10 -0500 Subject: [PATCH 1/2] MCOL-4116 add long LONGDOUBLE support to update --- writeengine/server/we_dmlcommandproc.cpp | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index 191dd56ea..928544739 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -3121,6 +3121,20 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, break; } + case CalpontSystemCatalog::LONGDOUBLE: + { + double dll = row.getDoubleField(fetchColPos); + + if (dll == std::numeric_limits::infinity()) + continue; + + ostringstream os; + //@Bug 3350 fix the precision. + os << setprecision(16) << dll; + value = os.str(); + break; + } + default: // treat as int64 { ostringstream os; @@ -3467,6 +3481,20 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, break; } + case CalpontSystemCatalog::LONGDOUBLE: + { + long double dll = row.getLongDoubleField(fetchColPos); + + if (dll == std::numeric_limits::infinity()) + continue; + + ostringstream os; + //@Bug 3350 fix the precision. + os << setprecision(16) << dll; + value = os.str(); + break; + } + default: // treat as int64 { ostringstream os; From 60dfe38b63d89a50749e7645a1ca4e7f984cb077 Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 8 Jul 2020 10:26:36 -0500 Subject: [PATCH 2/2] MCOL-4116 Set precision for long double to 19 --- writeengine/server/we_dmlcommandproc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index 928544739..bf7c7f66e 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -3123,14 +3123,14 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, case CalpontSystemCatalog::LONGDOUBLE: { - double dll = row.getDoubleField(fetchColPos); + long double dll = row.getLongDoubleField(fetchColPos); - if (dll == std::numeric_limits::infinity()) + if (dll == std::numeric_limits::infinity()) continue; ostringstream os; //@Bug 3350 fix the precision. - os << setprecision(16) << dll; + os << setprecision(19) << dll; value = os.str(); break; } @@ -3490,7 +3490,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, ostringstream os; //@Bug 3350 fix the precision. - os << setprecision(16) << dll; + os << setprecision(19) << dll; value = os.str(); break; }