Date: Friday, October 27, 2006 @ 15:17:33
  Author: csaba
    Path: /cvsroot/carob/libmysequoia/src

Modified: CarobMySQL.cpp (1.87 -> 1.88)

Catch "set autocommit", "commit" and "rollback" and match to the 
mysql_autocommit, mysql_commit and mysql_rollback functions respectively. Fixes 
for LMS-29


----------------+
 CarobMySQL.cpp |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletion(-)


Index: libmysequoia/src/CarobMySQL.cpp
diff -u libmysequoia/src/CarobMySQL.cpp:1.87 
libmysequoia/src/CarobMySQL.cpp:1.88
--- libmysequoia/src/CarobMySQL.cpp:1.87        Fri Oct 20 20:40:52 2006
+++ libmysequoia/src/CarobMySQL.cpp     Fri Oct 27 15:17:33 2006
@@ -318,9 +318,9 @@
 
   // catch the "set names ..." queries and set the client encodings
   // do not send the query to the server
+  const char *p = query, *q = 0;
   if (parse)
   {
-    const char *p = query, *q = 0;
     bool result = false;
     if (string_match(p, "set") && string_match(p, "names") && (q = 
get_next_string(p)) && (p - q < MAX_CHARSET_LEN))
     {
@@ -337,6 +337,21 @@
     }
   }
 
+  // catch the "set autocommit=0/1" and map to mysql_autocommit()
+  p = query; q = 0;
+  if (string_match(p, "set") && string_match(p, "autocommit") && 
string_match(p, "=") && (q = get_next_string(p)))
+    return set_autocommit(atoi(q));
+
+  // catch the "commit" and map to mysql_commit()
+  p = query; q = 0;
+  if (string_match(p, "commit") && (q = get_next_string(p)) && (*q == '\0'))
+    return commit();
+   
+  // catch the "rollback" and map to mysql_rollback()
+  p = query; q = 0;
+  if (string_match(p, "rollback") && (q = get_next_string(p)) && (*q == '\0'))
+    return rollback();
+
   try {  
     try {
       drsPtr = NULL;

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

Reply via email to