mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Ido*sqlConnection#FieldToEscapedString(): don't overflow timestamps > long
This commit is contained in:
parent
2c0925cedd
commit
ecce7f8dcb
@ -891,9 +891,9 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||
|
||||
*result = static_cast<long>(dbrefcol);
|
||||
} else if (DbValue::IsTimestamp(value)) {
|
||||
long ts = rawvalue;
|
||||
double ts = rawvalue;
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "FROM_UNIXTIME(" << ts << ")";
|
||||
msgbuf << "FROM_UNIXTIME(" << std::fixed << std::setprecision(0) << ts << ")";
|
||||
*result = Value(msgbuf.str());
|
||||
} else if (DbValue::IsObjectInsertID(value)) {
|
||||
auto id = static_cast<long>(rawvalue);
|
||||
|
@ -700,9 +700,9 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
|
||||
|
||||
*result = static_cast<long>(dbrefcol);
|
||||
} else if (DbValue::IsTimestamp(value)) {
|
||||
long ts = rawvalue;
|
||||
double ts = rawvalue;
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
|
||||
msgbuf << "TO_TIMESTAMP(" << std::fixed << std::setprecision(0) << ts << ") AT TIME ZONE 'UTC'";
|
||||
*result = Value(msgbuf.str());
|
||||
} else if (DbValue::IsObjectInsertID(value)) {
|
||||
auto id = static_cast<long>(rawvalue);
|
||||
|
Loading…
x
Reference in New Issue
Block a user