]> granicus.if.org Git - pdns/commitdiff
ease compilation against older mysql libraries
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 23 May 2011 17:27:52 +0000 (17:27 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 23 May 2011 17:27:52 +0000 (17:27 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2198 d19b8d6e-7fed-0310-83ef-9ca221ded41b

modules/gmysqlbackend/smysql.cc

index 12636f4d2e66f22abeaab6f1092fcac16851ff54..61ed5930b9e62026e98154682de3a77965ffcc90 100644 (file)
@@ -18,9 +18,17 @@ SMySQL::SMySQL(const string &database, const string &host, uint16_t port, const
   mysql_options(&d_db, MYSQL_READ_DEFAULT_GROUP, "client");
   my_bool reconnect = 1;
   mysql_options(&d_db, MYSQL_OPT_RECONNECT, &reconnect);
-  unsigned int timeout = 10;
-  mysql_options(&d_db, MYSQL_OPT_READ_TIMEOUT, &timeout);
-  mysql_options(&d_db, MYSQL_OPT_WRITE_TIMEOUT, &timeout);
+
+  
+#ifdef MYSQL_OPT_READ_TIMEOUT  
+  unsigned int rtimeout = 10;
+  mysql_options(&d_db, MYSQL_OPT_READ_TIMEOUT, &rtimeout);
+#endif
+#ifdef MYSQL_OPT_WRITE_TIMEOUT
+  unsigned int wtimeout = 10;
+  mysql_options(&d_db, MYSQL_OPT_WRITE_TIMEOUT, &wtimeout);
+#endif
+
   
   if (!mysql_real_connect(&d_db, host.empty() ? 0 : host.c_str(), 
                          user.empty() ? 0 : user.c_str(),