diff options
author | Adam <Adam@anope.org> | 2016-11-04 22:56:15 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-11-04 22:56:15 -0400 |
commit | ac0f3c5ccf9610f38204d5f9f8876657ce6acfb5 (patch) | |
tree | f98b3979055f703bfef6e4bcce8238ca7c000c3a /modules/extra/m_mysql.cpp | |
parent | 76ea11198028b6a1ab4f739d239bf890ce6d937e (diff) |
m_mysql: null empty columns instead of setting to ''
Diffstat (limited to 'modules/extra/m_mysql.cpp')
-rw-r--r-- | modules/extra/m_mysql.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index 06cce3143..67e43fcdb 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -446,7 +446,15 @@ Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Dat { Anope::string buf; *it->second >> buf; - query.SetValue(it->first, buf); + + bool escape = true; + if (buf.empty()) + { + buf = "NULL"; + escape = false; + } + + query.SetValue(it->first, buf, escape); } return query; |