diff options
author | Sadie Powell <sadie@witchery.services> | 2025-02-20 13:07:14 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-02-20 13:07:14 +0000 |
commit | bf68d1c0e026e7020993a83d4288a86d84a4fcfc (patch) | |
tree | 9d7727af45fb7e6fd1ed404cd2419d379c7381cc | |
parent | b498f4f4d91ff09120bfce6a10f7362fc40a011a (diff) | |
parent | 227caba7838f680c24e730ad3a4f534b59763dbc (diff) |
Merge branch '2.0' into 2.1.
-rw-r--r-- | modules/database/db_sql_live.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index 3a02bd0c5..e0f3adb08 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -173,7 +173,11 @@ public: if (!this->CheckInit() || obj->GetTimestamp() == Anope::CurTime) return; - Query query("SELECT * FROM `" + GetTableName(obj) + "` WHERE (`timestamp` >= " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)"); + Anope::string sql = Anope::printf("SELECT * from `%s`", GetTableName(obj).c_str()); + if (obj->GetTimestamp()) + sql += Anope::printf(" WHERE (`timestamp` >= %s OR `timestamp` IS NULL)", this->SQL->FromUnixtime(obj->GetTimestamp()).c_str()); + + Query query(sql); obj->UpdateTimestamp(); |