X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_sqlv2.h;h=a48b9b147c6fe806d7c6a1bd9116de0063516b47;hb=5a88424dbb33ac825aa0b9b6525179329ee75519;hp=3272efec5802d8c550b18e97dc30e09864a96fd4;hpb=c9408c6c43e5ea2be81fe070c3e96f84f8c6d5dc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_sqlv2.h b/src/modules/extra/m_sqlv2.h index 3272efec5..a48b9b147 100644 --- a/src/modules/extra/m_sqlv2.h +++ b/src/modules/extra/m_sqlv2.h @@ -30,6 +30,14 @@ typedef std::deque ParamL; */ class SQLexception : public ModuleException { + public: + SQLexception(const std::string &reason) : ModuleException(reason) + { + } + + SQLexception() : ModuleException("SQLv2: Undefined exception") + { + } }; /** An exception thrown when a bad column or row name or id is requested @@ -37,7 +45,9 @@ class SQLexception : public ModuleException class SQLbadColName : public SQLexception { public: - SQLbadColName() { } + SQLbadColName() : SQLexception("SQLv2: Bad column name") + { + } }; /** SQLerror holds the error state of any SQLrequest or SQLresult. @@ -149,7 +159,6 @@ public: SQLquery(const std::string &query) : q(query) { - log(DEBUG, "SQLquery constructor: %s", q.c_str()); } /** Initialize an SQLquery with a format string and parameters. @@ -159,7 +168,6 @@ public: SQLquery(const std::string &query, const ParamL ¶ms) : q(query), p(params) { - log(DEBUG, "SQLquery constructor with %d params: %s", p.size(), q.c_str()); } /** An overloaded operator for pushing parameters onto the parameter list @@ -221,7 +229,7 @@ public: * @param q A properly initialized SQLquery object. */ SQLrequest(Module* s, Module* d, const std::string &databaseid, const SQLquery &q) - : Request(SQLREQID, s, d), query(q), dbid(databaseid), pri(false), id(0) + : Request(s, d, SQLREQID), query(q), dbid(databaseid), pri(false), id(0) { } @@ -259,7 +267,7 @@ public: /** Initialize an SQLfield */ - SQLfield(const std::string &data, bool n) + SQLfield(const std::string &data = "", bool n = false) : d(data), null(n) { @@ -307,7 +315,7 @@ public: /** Used by the SQL API to instantiate an SQLrequest */ SQLresult(Module* s, Module* d, unsigned long i) - : Request(SQLRESID, s, d), id(i) + : Request(s, d, SQLRESID), id(i) { }