Author: wyoung
Date: Fri Jul 13 02:47:29 2007
New Revision: 1686

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1686&view=rev
Log:
Removed Connection ctor and Connection::connect() parameters for turning
on compression and setting the connection timeout.  Both can be set via
Connection::set_option() instead.

Modified:
    trunk/Wishlist
    trunk/lib/connection.cpp
    trunk/lib/connection.h

Modified: trunk/Wishlist
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/Wishlist?rev=1686&r1=1685&r2=1686&view=diff
==============================================================================
--- trunk/Wishlist (original)
+++ trunk/Wishlist Fri Jul 13 02:47:29 2007
@@ -59,10 +59,6 @@
         made into a base class that all SSQLSes derive from.  Some
         template functions like Query::insert<T> might become regular
         member functions, taking a reference to the SSQLS base class.
-
-    o Remove Connection::connect() arguments for turning on compression
-      and setting the connection timeout.  These things are already
-      provided by Connection::set_option().
 
     o Save error message built in Connection::bad_option() in an
       instance variable, used by Connection::error() when set.

Modified: trunk/lib/connection.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1686&r1=1685&r2=1686&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Fri Jul 13 02:47:29 2007
@@ -115,15 +115,13 @@
 
 Connection::Connection(const char* db, const char* host,
                const char* user, const char* passwd, uint port,
-               my_bool compress, unsigned int connect_timeout,
-               cchar* socket_name, unsigned int client_flag) :
+               cchar* socket_name, unsigned long client_flag) :
 OptionalExceptions(),
 Lockable(false),
 connecting_(false)
 {
        mysql_init(&mysql_);
-       if (connect(db, host, user, passwd, port, compress,
-                       connect_timeout, socket_name, client_flag)) {
+       if (connect(db, host, user, passwd, port, socket_name, client_flag)) {
                unlock();
                copacetic_ = is_connected_ = true;
        }
@@ -162,9 +160,8 @@
 
 bool
 Connection::connect(cchar* db, cchar* host, cchar* user,
-               cchar* passwd, uint port, my_bool compress,
-               unsigned int connect_timeout, cchar* socket_name,
-               unsigned int client_flag)
+               cchar* passwd, uint port, cchar* socket_name,
+               unsigned long client_flag)
 {
        lock();
 
@@ -173,13 +170,9 @@
                disconnect();
        }
 
-       // Set defaults for certain connection options.  User can override
-       // these by calling set_option() before connect().
+       // Set defaults for connection options.  User can override these
+       // by calling set_option() before connect().
        set_option_default(opt_read_default_file, "my");
-       set_option_default(opt_connect_timeout, connect_timeout);
-       if (compress) {
-               set_option_default(opt_compress);
-       }
 
 #if MYSQL_VERSION_ID >= 40101
        // Check to see if user turned on multi-statements before
@@ -221,9 +214,7 @@
 Connection::connect(const MYSQL& mysql)
 {
        return connect(mysql.db, mysql.host, mysql.user, mysql.passwd,
-                       mysql.port, mysql.options.compress,
-                       mysql.options.connect_timeout, mysql.unix_socket,
-                       mysql.client_flag);
+                       mysql.port, mysql.unix_socket, mysql.client_flag);
 }
 
 

Modified: trunk/lib/connection.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.h?rev=1686&r1=1685&r2=1686&view=diff
==============================================================================
--- trunk/lib/connection.h (original)
+++ trunk/lib/connection.h Fri Jul 13 02:47:29 2007
@@ -119,9 +119,9 @@
        /// This constructor allows you to most fully specify the options
        /// used when connecting to the MySQL database.  It is the thinnest
        /// layer in MySQL++ over the MySQL C API function
-       /// \c mysql_real_connect().  The correspondence isn't exact as
-       /// we have some additional parameters you'd have to set with
-       /// \c mysql_option() when using the C API.
+       /// \c mysql_real_connect().  The correspondence isn't exact, as we
+       /// reorder some of the parameters, give most of them defaults, and
+       /// leave some of them out.
        ///
        /// \param db name of database to use
        /// \param host host name or IP address of MySQL server, or 0
@@ -131,20 +131,15 @@
        /// \param passwd password to use when logging in
        /// \param port TCP port number MySQL server is listening on, or 0
        ///             to use default value
-       /// \param compress if true, compress data passing through
-       ///             connection, to save bandwidth at the expense of CPU time
-       /// \param connect_timeout max seconds to wait for server to
-       ///             respond to our connection attempt
        /// \param socket_name Unix domain socket server is using, if
        ///             connecting to MySQL server on the same host as this 
program
        ///             running on, or 0 to use default name
-       ///     \param client_flag special connection flags. See MySQL C API
-       ///             documentation for \c mysql_real_connect() for details.
+       /// \param client_flag special connection flags. See MySQL C API
+       ///     documentation for \c mysql_real_connect() for details.  
        Connection(const char* db, const char* host = "",
                        const char* user = "", const char* passwd = "",
-                       uint port = 0, my_bool compress = 0,
-                       unsigned int connect_timeout = 60, cchar* socket_name = 
0,
-                       unsigned int client_flag = 0);
+                       uint port = 0, cchar* socket_name = 0,
+                       unsigned long client_flag = 0);
 
        /// \brief Establish a new connection using the same parameters as
        /// an existing C API connection.
@@ -171,8 +166,7 @@
        /// new connection is established.
        bool connect(cchar* db = "", cchar* host = "",
                        cchar* user = "", cchar* passwd = "", uint port = 0,
-                       my_bool compress = 0, unsigned int connect_timeout = 60,
-                       cchar* socket_name = 0, unsigned int client_flag = 0);
+                       cchar* socket_name = 0, unsigned long client_flag = 0);
 
        /// \brief Close connection to MySQL server.
        ///


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

Reply via email to