diff options
Diffstat (limited to 'src/modules/extra/m_pgsql.cpp')
| -rw-r--r-- | src/modules/extra/m_pgsql.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 39849271d..c7feb2a22 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -31,7 +31,7 @@ #include "m_sqlv2.h" /* $ModDesc: PostgreSQL Service Provider module for all other m_sql* modules, uses v2 of the SQL API */ -/* $CompileFlags: -I`pg_config --includedir` */ +/* $CompileFlags: -I`pg_config --includedir` `perl extra/pgsql_config.pl` */ /* $LinkerFlags: -L`pg_config --libdir` -lpq */ /* UGH, UGH, UGH, UGH, UGH, UGH @@ -956,8 +956,13 @@ SQLerror SQLConn::DoQuery(const SQLrequest &req) char* query = new char[(req.query.q.length()*2)+1]; int error = 0; - - // PQescapeStringConn(sql, query, req.query.q.c_str(), req.query.q.length(), error); + +#ifdef PGSQL_HAS_ESCAPECONN + PQescapeStringConn(sql, query, req.query.q.c_str(), req.query.q.length(), &error); +#else + PQescapeString(query, req.query.q.c_str(), req.query.q.length()); + error = 0; +#endif if(error == 0) { |
