Date: Thursday, January 25, 2007 @ 14:16:43
  Author: csaba
    Path: /cvsroot/carob/libmysequoia/src

Modified: CarobMySQL.cpp (1.97 -> 1.98)

Make thinks work with the mysql command line client.


----------------+
 CarobMySQL.cpp |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)


Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.97 
libmysequoia/src/CarobMySQL.cpp:1.98
--- libmysequoia/src/CarobMySQL.cpp:1.97        Wed Dec 20 16:26:04 2006
+++ libmysequoia/src/CarobMySQL.cpp     Thu Jan 25 14:16:43 2007
@@ -113,7 +113,7 @@
   if (mysqlPtr->status != MYSQL_STATUS_READY)
   {
     set_error(CR_COMMANDS_OUT_OF_SYNC, SQLT_UNKNOWN);
-    LOG4CXX_DEBUG(logger, "Leaving connect.");
+    LOG4CXX_DEBUG(logger, "Leaving connect: command out of sync");
     return false;
   }
 
@@ -124,13 +124,6 @@
     FREE_AND_NULL_ARRAY(mysqlPtr->options.my_cnf_group);
   }
 
-  if (unix_socket)
-  {
-    set_error(CR_SOCKET_CREATE_ERROR, SQLT_UNKNOWN);
-    LOG4CXX_DEBUG(logger, "Leaving connect.");
-    return false;
-  }
-
   /* Must supply at least a user name, or connection to sequoia will fail */
   if (!user || !*user)
   {
@@ -138,7 +131,7 @@
     if (!user || !*user)
     {
       set_error(CR_NULL_POINTER, SQLT_UNKNOWN);
-      LOG4CXX_DEBUG(logger, "Leaving connect.");
+      LOG4CXX_DEBUG(logger, "Leaving connect: user name missing.");
       return false;
     }
   }
@@ -184,7 +177,7 @@
         delete_connection();
         set_connect_info(host, user, passwd, 0, port);
     
-        LOG4CXX_DEBUG(logger, "Leaving connect (delayed connection.)");
+        LOG4CXX_DEBUG(logger, "Leaving connect: delayed connection.");
         return true;
       }
     }
@@ -234,28 +227,28 @@
     catch (BackendException &e)
     {
       set_error(e);
-      LOG4CXX_DEBUG(logger, "Leaving connect.");
+      LOG4CXX_DEBUG(logger, "Leaving connect: backend exception.");
       return false;
     }
     catch (CarobException &e)
     {
       set_error(e.getErrorCode(), from_wstring(e.description()).c_str(), 
from_wstring(e.getSQLState()).c_str());
       //TODO error handling
-      LOG4CXX_DEBUG(logger, "Leaving connect.");
+      LOG4CXX_DEBUG(logger, "Leaving connect: carob exception.");
       return false;
     }
     catch (HostTokenizerException &e)
     {
       set_error(0, e.description().c_str(), error_sqlstate[SQLT_UNKNOWN]);
       //TODO error handling
-      LOG4CXX_DEBUG(logger, "Leaving connect.");
+      LOG4CXX_DEBUG(logger, "Leaving connect: host tokenizer exception.");
       return false;
     }
   }
   catch (ConverterException &e)
   {
     set_error(0, e.description().c_str(), error_sqlstate[SQLT_UNKNOWN]);
-    LOG4CXX_DEBUG(logger, "Leaving connect.");
+    LOG4CXX_DEBUG(logger, "Leaving connect: converter exception.");
     return false;
   }
 }
@@ -314,7 +307,12 @@
 
   LOG4CXX_INFO(logger, "Executing query=" << query << " length=" << length);
 
-  if (mysqlPtr->status != MYSQL_STATUS_READY || !connectionPtr)
+/*
+ * mysql command line client without -A option will not work
+ *  
+ * if (mysqlPtr->status != MYSQL_STATUS_READY || !connectionPtr)
+ */
+  if (!connectionPtr)
   {
     set_error(CR_COMMANDS_OUT_OF_SYNC, SQLT_UNKNOWN);
     LOG4CXX_DEBUG(logger, "Leaving real_query: result=0");

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

Reply via email to