Date: Thursday, October 5, 2006 @ 09:55:50
  Author: csaba
    Path: /cvsroot/carob/libmysequoia

Modified: config/mysequoia.conf (1.6 -> 1.7) include/CarobMySQL.hpp (1.36
          -> 1.37) src/CarobMySQL.cpp (1.82 -> 1.83)

Changed persistent_connectionS to persistent_connection.


------------------------+
 config/mysequoia.conf  |    2 +-
 include/CarobMySQL.hpp |    4 ++--
 src/CarobMySQL.cpp     |   23 ++++++++++++++---------
 3 files changed, 17 insertions(+), 12 deletions(-)


Index: libmysequoia/config/mysequoia.conf
diff -u libmysequoia/config/mysequoia.conf:1.6 
libmysequoia/config/mysequoia.conf:1.7
--- libmysequoia/config/mysequoia.conf:1.6      Fri Sep 29 17:36:37 2006
+++ libmysequoia/config/mysequoia.conf  Thu Oct  5 09:55:50 2006
@@ -6,4 +6,4 @@
 ;password = realpassword
 ;host = node1 node2
 ;database = DB1
-;persistent_connections = false
\ No newline at end of file
+;persistent_connection = false
Index: libmysequoia/include/CarobMySQL.hpp
diff -u libmysequoia/include/CarobMySQL.hpp:1.36 
libmysequoia/include/CarobMySQL.hpp:1.37
--- libmysequoia/include/CarobMySQL.hpp:1.36    Fri Sep 29 17:36:37 2006
+++ libmysequoia/include/CarobMySQL.hpp Thu Oct  5 09:55:50 2006
@@ -288,8 +288,8 @@
   log4cxx::helpers::CriticalSection cs_carobStmts;
   // character conversions
   Converter conv;
-  // persistent connections
-  bool usePersistentConnections;
+  // persistent connection
+  bool usePersistentConnection;
   
   /**
    * Private default constructor.
Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.82 
libmysequoia/src/CarobMySQL.cpp:1.83
--- libmysequoia/src/CarobMySQL.cpp:1.82        Tue Oct  3 10:29:30 2006
+++ libmysequoia/src/CarobMySQL.cpp     Thu Oct  5 09:55:50 2006
@@ -40,7 +40,7 @@
 using namespace std;
 
 CarobMYSQL::CarobMYSQL (MYSQL *mysql, my_bool free_me) :
-   connectionPtr(0), stmtPtr(0), drsPtr(0), liveResultPtr(0), 
usePersistentConnections(true)
+   connectionPtr(0), stmtPtr(0), drsPtr(0), liveResultPtr(0), 
usePersistentConnection(true)
 {
   LOG4CXX_DEBUG(logger, "Entering constructor; mysql=" << mysql << " free_me=" 
<< (bool) free_me);
   static char version[6];
@@ -200,8 +200,8 @@
         LOG4CXX_DEBUG(logger, "Connect (adding host): host=" << hti->host << " 
port=" << hti->port);
       }
       
-      // we can retrieve the warnings only if we have persistent connections
-      ConnectionParameters connectionParameters(ctrls, to_wstring(db), 
to_wstring(user), to_wstring(passwd), ht.getPolicy(), usePersistentConnections, 
usePersistentConnections?true:false);
+      // we can retrieve the warnings only if we have persistent connection
+      ConnectionParameters connectionParameters(ctrls, to_wstring(db), 
to_wstring(user), to_wstring(passwd), ht.getPolicy(), usePersistentConnection, 
usePersistentConnection?true:false);
       
       Connection *newConnectionPtr = new Connection(connectionParameters);
       
@@ -211,7 +211,7 @@
         delete_connection();
         set_connect_info(host, user, passwd, db, port);
   
-        LOG4CXX_INFO(logger, "Connected: host=" << host << " user=" << user << 
" passwd=" << passwd << " db=" << db << " port=" << port << " 
persistent_connections=" << usePersistentConnections);
+        LOG4CXX_INFO(logger, "Connected: host=" << host << " user=" << user << 
" passwd=" << passwd << " db=" << db << " port=" << port << " 
persistent_connection=" << usePersistentConnection);
         
         reset_error();
   
@@ -409,8 +409,8 @@
 
   unsigned int result = 0;
 
-  // we can retrieve the warnings only if we have persistent connections
-  if (stmtPtr && usePersistentConnections)
+  // we can retrieve the warnings only if we have persistent connection
+  if (stmtPtr && usePersistentConnection)
   {
     SQLWarning *warnings = stmtPtr->getWarnings();
      while (warnings)
@@ -1177,9 +1177,9 @@
   /* read the init_command from the config file */
   push_init_command(ini.get(group, "init_command").c_str());
 
-  /* set persistent connections */
-  if (strncmp(ini.get(group, "persistent_connections").c_str(), "false", 5) == 
0)
-    usePersistentConnections = false;
+  /* set persistent connection */
+  if (strncmp(ini.get(group, "persistent_connection").c_str(), "false", 5) == 
0)
+    usePersistentConnection = false;
   
   LOG4CXX_DEBUG(logger, "Leaving read_ini_file.");
 }
@@ -1240,7 +1240,12 @@
 CarobMYSQL::real_escape_string (char *to, const char *from, unsigned long 
length)
 {
   if (length == 0)
+  {
+    if (to)
+      *to = '\0';
+      
     return 0;
+  }
   
   try
   {

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to