Author: wyoung
Date: Sat Dec 22 10:54:50 2007
New Revision: 2014

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2014&view=rev
Log:
Moved another mysql_* API call to DBDriver

Modified:
    trunk/lib/dbdriver.h
    trunk/lib/query.cpp

Modified: trunk/lib/dbdriver.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/dbdriver.h?rev=2014&r1=2013&r2=2014&view=diff
==============================================================================
--- trunk/lib/dbdriver.h (original)
+++ trunk/lib/dbdriver.h Sat Dec 22 10:54:50 2007
@@ -174,11 +174,20 @@
        /// Wraps \c mysql_errno() in the MySQL C API.
        int errnum() { return mysql_errno(&mysql_); }
 
-       /// \brief SQL-escapes the given string
+       /// \brief SQL-escapes the given string, taking into account the
+    /// default character set of the database server we're connected to.
        ///
        /// Wraps \c mysql_real_escape_string() in the MySQL C API.
        size_t escape_string(char* to, const char* from, size_t length)
                        { return mysql_real_escape_string(&mysql_, to, from, 
length); }
+
+       /// \brief SQL-escapes the given string without reference to the 
+    /// character set of a database server.
+       ///
+       /// Wraps \c mysql_escape_string() in the MySQL C API.
+       static size_t escape_string_no_conn(char* to, const char* from,
+            size_t length)
+                       { return mysql_escape_string(to, from, length); }
 
        /// \brief Executes the given query string
        ///

Modified: trunk/lib/query.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/query.cpp?rev=2014&r1=2013&r2=2014&view=diff
==============================================================================
--- trunk/lib/query.cpp (original)
+++ trunk/lib/query.cpp Sat Dec 22 10:54:50 2007
@@ -131,7 +131,7 @@
        else {
                // Should only happen in test/test_manip.cpp, since it doesn't
                // want to open a DB connection just to test the manipulators.
-               return mysql_escape_string(escaped, original, length);
+               return DBDriver::escape_string_no_conn(escaped, original, 
length);
        }
 }
 


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to