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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user