Remove unused timestamp function in DB IDO

refs #6584
This commit is contained in:
Michael Friedrich 2018-09-17 10:06:30 +02:00
parent c9db7a0dac
commit c0c17fc340
4 changed files with 0 additions and 21 deletions

View File

@ -33,11 +33,6 @@ Value DbValue::FromTimestamp(const Value& ts)
return new DbValue(DbValueTimestamp, ts);
}
Value DbValue::FromTimestampNow()
{
return new DbValue(DbValueTimestampNow, Empty);
}
Value DbValue::FromValue(const Value& value)
{
return value;
@ -57,15 +52,6 @@ bool DbValue::IsTimestamp(const Value& value)
return dbv->GetType() == DbValueTimestamp;
}
bool DbValue::IsTimestampNow(const Value& value)
{
if (!value.IsObjectType<DbValue>())
return false;
DbValue::Ptr dbv = value;
return dbv->GetType() == DbValueTimestampNow;
}
bool DbValue::IsObjectInsertID(const Value& value)
{
if (!value.IsObjectType<DbValue>())

View File

@ -30,7 +30,6 @@ namespace icinga
enum DbValueType
{
DbValueTimestamp,
DbValueTimestampNow,
DbValueObjectInsertID
};
@ -47,12 +46,10 @@ public:
DbValue(DbValueType type, Value value);
static Value FromTimestamp(const Value& ts);
static Value FromTimestampNow();
static Value FromValue(const Value& value);
static Value FromObjectInsertID(const Value& value);
static bool IsTimestamp(const Value& value);
static bool IsTimestampNow(const Value& value);
static bool IsObjectInsertID(const Value& value);
static Value ExtractValue(const Value& value);

View File

@ -831,8 +831,6 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
std::ostringstream msgbuf;
msgbuf << "FROM_UNIXTIME(" << ts << ")";
*result = Value(msgbuf.str());
} else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()";
} else if (DbValue::IsObjectInsertID(value)) {
auto id = static_cast<long>(rawvalue);

View File

@ -675,8 +675,6 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
std::ostringstream msgbuf;
msgbuf << "TO_TIMESTAMP(" << ts << ") AT TIME ZONE 'UTC'";
*result = Value(msgbuf.str());
} else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()";
} else if (DbValue::IsObjectInsertID(value)) {
auto id = static_cast<long>(rawvalue);