Author: wyoung
Date: Tue Dec 20 08:45:54 2005
New Revision: 1159
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1159&view=rev
Log:
Added a new option for Connection::set_option(), to enable the automatic
reconnect feature in MySQL 5.0.13 and up. Patch by Arnon Jalon
<[EMAIL PROTECTED]>
Modified:
trunk/lib/connection.cpp
trunk/lib/connection.h
Modified: trunk/lib/connection.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.cpp?rev=1159&r1=1158&r2=1159&view=diff
==============================================================================
--- trunk/lib/connection.cpp (original)
+++ trunk/lib/connection.cpp Tue Dec 20 08:45:54 2005
@@ -95,6 +95,7 @@
Connection::opt_type_boolean, // opt_secure_auth
Connection::opt_type_boolean, // opt_multi_statements
Connection::opt_type_boolean, // opt_report_data_truncation
+ Connection::opt_type_boolean, // opt_reconnect
};
@@ -412,6 +413,10 @@
#if MYSQL_VERSION_ID >= 50003
case opt_report_data_truncation:
return
set_option_impl(MYSQL_REPORT_DATA_TRUNCATION, &my_arg);
+#endif
+#if MYSQL_VERSION_ID >= 50013
+ case opt_reconnect:
+ return set_option_impl(MYSQL_OPT_RECONNECT,
&my_arg);
#endif
case opt_FIRST: // warning eater when using old C APIs
default:
Modified: trunk/lib/connection.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/connection.h?rev=1159&r1=1158&r2=1159&view=diff
==============================================================================
--- trunk/lib/connection.h (original)
+++ trunk/lib/connection.h Tue Dec 20 08:45:54 2005
@@ -101,6 +101,10 @@
// Set reporting of data truncation errors
opt_report_data_truncation,
+ // Enable or disable automatic reconnection to the server if
+ // the connection is found to have been lost.
+ opt_reconnect,
+
// Number of options supported. Never send this to
// set_option()!
opt_COUNT