diff options
Diffstat (limited to 'modules/database/db_sql.cpp')
-rw-r--r-- | modules/database/db_sql.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index f6af798b4..6add33f93 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -243,11 +243,13 @@ class DBSQL : public Module, public Pipe if (obj) { + /* The Unserialize operation is destructive so rebuild the data for UpdateCache. + * Also the old data may contain columns that we don't use, so we reserialize the + * object to know for sure our cache is consistent + */ + Data data2; - /* The Unserialize operation is destructive so rebuild the data for UpdateCache */ - for (std::map<Anope::string, Anope::string>::const_iterator rit = row.begin(), rit_end = row.end(); rit != rit_end; ++rit) - if (rit->first != "id" && rit->first != "timestamp") - data2[rit->first] << rit->second; + obj->Serialize(data2); obj->UpdateCache(data2); /* We know this is the most up to date copy */ } } |