summaryrefslogtreecommitdiff
path: root/modules/database/db_sql_live.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-25 03:09:51 -0500
committerAdam <Adam@anope.org>2013-01-25 03:09:51 -0500
commit76d9e58ae59ca99452ebaeedef661d0f82fc7104 (patch)
tree014661d8ceb6d422a7cafbd1a97ef3095fea04f4 /modules/database/db_sql_live.cpp
parent3769cc1a3597dd70e88c305540a61984db2626af (diff)
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.
Diffstat (limited to 'modules/database/db_sql_live.cpp')
-rw-r--r--modules/database/db_sql_live.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp
index 156e6e120..aec84c8ef 100644
--- a/modules/database/db_sql_live.cpp
+++ b/modules/database/db_sql_live.cpp
@@ -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();