From 19c8a2bd914ccd90c025f47104a502ae1d7706cc Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Tue, 9 Oct 2018 14:15:20 +0100 Subject: [PATCH] MCOL-266 Support true/false DDL default values --- utils/dataconvert/dataconvert.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/dataconvert/dataconvert.cpp b/utils/dataconvert/dataconvert.cpp index 832143c5b..1d196a436 100644 --- a/utils/dataconvert/dataconvert.cpp +++ b/utils/dataconvert/dataconvert.cpp @@ -29,6 +29,7 @@ #include using namespace std; #include +#include using namespace boost::algorithm; #include #include "calpontsystemcatalog.h" @@ -138,6 +139,15 @@ int64_t number_int_value(const string& data, if (y != string::npos) throw QueryDataExcept("')' is not matched.", formatErr); + if (boost::iequals(valStr, "true")) + { + return 1; + } + if (boost::iequals(valStr, "false")) + { + return 0; + } + // convert to fixed-point notation if input is in scientific notation if (valStr.find('E') < string::npos || valStr.find('e') < string::npos) {