diff --git a/lib/db_ido/dbvalue.cpp b/lib/db_ido/dbvalue.cpp index a626e59fe..9f1f22bc9 100644 --- a/lib/db_ido/dbvalue.cpp +++ b/lib/db_ido/dbvalue.cpp @@ -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()) - return false; - - DbValue::Ptr dbv = value; - return dbv->GetType() == DbValueTimestampNow; -} - bool DbValue::IsObjectInsertID(const Value& value) { if (!value.IsObjectType()) diff --git a/lib/db_ido/dbvalue.hpp b/lib/db_ido/dbvalue.hpp index fcb985409..146189ca0 100644 --- a/lib/db_ido/dbvalue.hpp +++ b/lib/db_ido/dbvalue.hpp @@ -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); diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index 051206231..24f6ce66d 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -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(rawvalue); diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp index 9771d4027..d895710e8 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.cpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp @@ -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(rawvalue);