1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-266 Support true/false DDL default values

This commit is contained in:
Andrew Hutchings
2018-10-09 14:15:20 +01:00
parent ca7cb9a7b1
commit 19c8a2bd91

View File

@ -29,6 +29,7 @@
#include <string.h>
using namespace std;
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string.hpp>
using namespace boost::algorithm;
#include <boost/tokenizer.hpp>
#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)
{