1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00

compilation fix for gcc12 on known gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105329

This commit is contained in:
Leonid Fedorov 2024-01-03 18:14:59 +00:00 committed by Leonid Fedorov
parent 72a4f916cf
commit 0d1c72a563
2 changed files with 6 additions and 7 deletions

View File

@ -1349,10 +1349,10 @@ TEST(Decimal, DecimalToStringCheckScale0)
datatypes::Decimal dec(0, scale, precision, res);
// test simple values
expected = "0";
expected = std::string("0");
EXPECT_EQ(dec.toString(), expected);
res = 2;
expected = "2";
expected = std::string("2");
dec.setTSInt128Value(res);
EXPECT_EQ(dec.toString(), expected);
res = -2;

View File

@ -19,7 +19,6 @@
// $Id: func_truncate.cpp 3921 2013-06-19 18:59:56Z bwilkinson $
#include <cstdlib>
#include <iomanip>
#include <string>
using namespace std;
@ -560,7 +559,7 @@ IDB_Decimal Func_truncate::getDecimalVal(Row& row, FunctionParm& parm, bool& isN
else
{
if (-s >= (int32_t)value.size())
value = "0";
value = std::string("0");
else
{
value = value.substr(0, value.size() + s);
@ -661,7 +660,7 @@ int64_t Func_truncate::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm
if (isNull)
return 0;
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
if (s < 0)
if (s < 0)
{
s = 0;
}
@ -677,7 +676,7 @@ int64_t Func_truncate::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isN
if (isNull)
return 0;
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
if (s < 0)
if (s < 0)
{
s = 0;
}
@ -693,7 +692,7 @@ int64_t Func_truncate::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, boo
if (isNull)
return 0;
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
if (s < 0)
if (s < 0)
{
s = 0;
}