mirror of
https://github.com/anope/anope.git
synced 2026-06-24 20:26:39 +02:00
mysql_insert_id doesn't return an id if one isnt generated, so
check that it really returns a value before using it. Also fix memos to cleanup after themselves when deleted.
This commit is contained in:
@@ -109,7 +109,7 @@ class DBMySQL : public Module, public Pipe
|
||||
this->RunQueryResult(create[i]);
|
||||
|
||||
Result res = this->RunQueryResult(this->SQL->BuildInsert(this->prefix + s_type->GetName(), obj->id, *data));
|
||||
if (obj->id != res.GetID())
|
||||
if (res.GetID() && obj->id != res.GetID())
|
||||
{
|
||||
/* In this case obj is new, so place it into the object map */
|
||||
obj->id = res.GetID();
|
||||
|
||||
Reference in New Issue
Block a user