mirror of https://github.com/Icinga/icinga2.git
parent
c9db7a0dac
commit
c0c17fc340
|
@ -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>())
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue