You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +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:
committed by
Leonid Fedorov
parent
cbf6eff94d
commit
d0f657b01f
@ -1349,10 +1349,10 @@ TEST(Decimal, DecimalToStringCheckScale0)
|
|||||||
datatypes::Decimal dec(0, scale, precision, res);
|
datatypes::Decimal dec(0, scale, precision, res);
|
||||||
|
|
||||||
// test simple values
|
// test simple values
|
||||||
expected = "0";
|
expected = std::string("0");
|
||||||
EXPECT_EQ(dec.toString(), expected);
|
EXPECT_EQ(dec.toString(), expected);
|
||||||
res = 2;
|
res = 2;
|
||||||
expected = "2";
|
expected = std::string("2");
|
||||||
dec.setTSInt128Value(res);
|
dec.setTSInt128Value(res);
|
||||||
EXPECT_EQ(dec.toString(), expected);
|
EXPECT_EQ(dec.toString(), expected);
|
||||||
res = -2;
|
res = -2;
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
// $Id: func_truncate.cpp 3921 2013-06-19 18:59:56Z bwilkinson $
|
// $Id: func_truncate.cpp 3921 2013-06-19 18:59:56Z bwilkinson $
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -560,7 +559,7 @@ IDB_Decimal Func_truncate::getDecimalVal(Row& row, FunctionParm& parm, bool& isN
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (-s >= (int32_t)value.size())
|
if (-s >= (int32_t)value.size())
|
||||||
value = "0";
|
value = std::string("0");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
value = value.substr(0, value.size() + s);
|
value = value.substr(0, value.size() + s);
|
||||||
@ -661,7 +660,7 @@ int64_t Func_truncate::getTimestampIntVal(rowgroup::Row& row, FunctionParm& parm
|
|||||||
if (isNull)
|
if (isNull)
|
||||||
return 0;
|
return 0;
|
||||||
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
s = 0;
|
s = 0;
|
||||||
}
|
}
|
||||||
@ -677,7 +676,7 @@ int64_t Func_truncate::getDatetimeIntVal(Row& row, FunctionParm& parm, bool& isN
|
|||||||
if (isNull)
|
if (isNull)
|
||||||
return 0;
|
return 0;
|
||||||
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
s = 0;
|
s = 0;
|
||||||
}
|
}
|
||||||
@ -693,7 +692,7 @@ int64_t Func_truncate::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, boo
|
|||||||
if (isNull)
|
if (isNull)
|
||||||
return 0;
|
return 0;
|
||||||
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
s = (s > MAX_MICROSECOND_PRECISION) ? MAX_MICROSECOND_PRECISION : s;
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
s = 0;
|
s = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user