1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 07:56:38 +02:00

Fix sql_live on recent MariaDB.

This commit is contained in:
Sadie Powell
2025-02-20 13:05:22 +00:00
parent b51dff0b1a
commit 227caba783
+5 -1
View File
@@ -174,7 +174,11 @@ class DBMySQL : public Module, public Pipe
if (!this->CheckInit() || obj->GetTimestamp() == Anope::CurTime)
return;
Query query("SELECT * FROM `" + this->prefix + obj->GetName() + "` WHERE (`timestamp` >= " + this->SQL->FromUnixtime(obj->GetTimestamp()) + " OR `timestamp` IS NULL)");
Anope::string sql = Anope::printf("SELECT * from `%s%s`", this->prefix.c_str(), obj->GetName().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();