Author: wyoung
Date: Fri Jun 22 17:52:48 2007
New Revision: 1584

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1584&view=rev
Log:
Better handling of opt_multi_statements option when connection is
already up.  (It's the only one that can be handled after connection is
up.)

Modified:
    trunk/lib/connection.cpp

Modified: trunk/lib/connection.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1584&r1=1583&r2=1584&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Fri Jun 22 17:52:48 2007
@@ -508,17 +508,10 @@
 bool
 Connection::set_option(Option option, bool arg)
 {
-       if (connected()) {
-               if (option == opt_multi_statements) {
-                       // This is the only option taking a bool argument that 
can
-                       // be set after the connection is already up.
-                       return set_option_impl(arg ?
-                                       MYSQL_OPTION_MULTI_STATEMENTS_ON :
-                                       MYSQL_OPTION_MULTI_STATEMENTS_OFF);
-               }
-               else {
-                       return bad_option(option, opt_err_conn);
-               }
+       if (connected() && (option != opt_multi_statements)) {
+               // We're connected and it isn't an option that can be set
+               // after connection is up, so complain to user.
+               return bad_option(option, opt_err_conn);
        }
 
        bool success = false;


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

Reply via email to