1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge branch 'develop-1.2' into develop-merge-up-20190328

This commit is contained in:
Andrew Hutchings
2019-03-28 15:09:21 +00:00
136 changed files with 3636 additions and 1242 deletions

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2016 MariaDB Corporaton
Copyright (C) 2019 MariaDB Corporaton
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -714,6 +714,61 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
//break;
}
case CalpontSystemCatalog::LONGDOUBLE:
{
long double dl = row.getLongDoubleField(s);
if (dl == std::numeric_limits<long double>::infinity())
{
continue;
}
switch((*f)->type())
{
case MYSQL_TYPE_NEWDECIMAL:
{
char buf[310];
Field_new_decimal* f2 = (Field_new_decimal*)*f;
if ((f2->decimals() == DECIMAL_NOT_SPECIFIED && row.getScale(s) > 0)
|| f2->decimals() < row.getScale(s))
{
f2->dec = row.getScale(s);
}
// dl /= pow(10.0, (double)f2->dec);
snprintf(buf, 310, "%.20Lg", dl);
f2->store(buf, strlen(buf), f2->charset());
if ((*f)->null_ptr)
*(*f)->null_ptr &= ~(*f)->null_bit;
}
break;
case MYSQL_TYPE_DOUBLE:
{
Field_double* f2 = (Field_double*)*f;
// bug 3483, reserve enough space for the longest double value
// -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
// 2.2250738585072014E-308 to 1.7976931348623157E+308.
(*f)->field_length = 310;
if ((f2->decimals() == DECIMAL_NOT_SPECIFIED && row.getScale(s) > 0)
|| f2->decimals() < row.getScale(s))
{
f2->dec = row.getScale(s);
}
f2->store(static_cast<double>(dl));
if ((*f)->null_ptr)
*(*f)->null_ptr &= ~(*f)->null_bit;
}
break;
default:
{
continue; // Shouldn't happen. Functions should not return long double to other than double or decimal return type.
}
}
break;
}
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL:
{