MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:December 15 2009 10:36pm
Subject:bzr commit into mysql-5.1-telco-6.2 branch (Martin.Skold:3052) Bug#49536
View as plain text  
#At file:///home/marty/MySQL/mysql-5.1-telco-6.2/

 3052 Martin Skold	2009-12-15 [merge]
      Merge
      modified:
        libmysql/libmysql.c
        sql/log.cc
        sql/log_event.cc

=== modified file 'libmysql/libmysql.c'
--- a/libmysql/libmysql.c	2009-09-30 18:51:17 +0000
+++ b/libmysql/libmysql.c	2009-12-15 10:55:00 +0000
@@ -2272,7 +2272,7 @@ mysql_stmt_param_metadata(MYSQL_STMT *st
 
 /* Store type of parameter in network buffer. */
 
-static void store_param_type(char **pos, MYSQL_BIND *param)
+static void store_param_type(unsigned char **pos, MYSQL_BIND *param)
 {
   uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0);
   int2store(*pos, typecode);
@@ -2552,7 +2552,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
 	that is sent to the server.
       */
       for (param= stmt->params;	param < param_end ; param++)
-        store_param_type((char**) &net->write_pos, param);
+        store_param_type(&net->write_pos, param);
     }
 
     for (param= stmt->params; param < param_end; param++)

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2009-09-30 18:51:17 +0000
+++ b/sql/log.cc	2009-12-14 08:40:33 +0000
@@ -4267,6 +4267,9 @@ bool general_log_write(THD *thd, enum en
 
 void MYSQL_BIN_LOG::rotate_and_purge(uint flags)
 {
+#ifdef HAVE_REPLICATION
+  bool check_purge= false;
+#endif
   if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED))
     pthread_mutex_lock(&LOCK_log);
   if ((flags & RP_FORCE_ROTATE) ||
@@ -4274,16 +4277,24 @@ void MYSQL_BIN_LOG::rotate_and_purge(uin
   {
     new_file_without_locking();
 #ifdef HAVE_REPLICATION
-    if (expire_logs_days)
-    {
-      time_t purge_time= my_time(0) - expire_logs_days*24*60*60;
-      if (purge_time >= 0)
-        purge_logs_before_date(purge_time);
-    }
+    check_purge= true;
 #endif
   }
   if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED))
     pthread_mutex_unlock(&LOCK_log);
+
+#ifdef HAVE_REPLICATION
+  /*
+    NOTE: Run purge_logs wo/ holding LOCK_log
+          as it otherwise will deadlock in ndbcluster_binlog_index_purge_file
+  */
+  if (check_purge && expire_logs_days)
+  {
+    time_t purge_time= my_time(0) - expire_logs_days*24*60*60;
+    if (purge_time >= 0)
+      purge_logs_before_date(purge_time);
+  }
+#endif
 }
 
 uint MYSQL_BIN_LOG::next_file_id()

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2009-10-05 10:29:36 +0000
+++ b/sql/log_event.cc	2009-12-14 15:02:56 +0000
@@ -2141,8 +2141,8 @@ void Query_log_event::pack_info(Protocol
 /**
   Utility function for the next method (Query_log_event::write()) .
 */
-static void write_str_with_code_and_len(char **dst, const char *src,
-                                        int len, uint code)
+static void write_str_with_code_and_len(uchar **dst, const char *src,
+                                        uint len, uint code)
 {
   /*
     only 1 byte to store the length of catalog, so it should not
@@ -2237,7 +2237,7 @@ bool Query_log_event::write(IO_CACHE* fi
   }
   if (catalog_len) // i.e. this var is inited (false for 4.0 events)
   {
-    write_str_with_code_and_len((char **)(&start),
+    write_str_with_code_and_len(&start,
                                 catalog, catalog_len, Q_CATALOG_NZ_CODE);
     /*
       In 5.0.x where x<4 masters we used to store the end zero here. This was
@@ -2275,7 +2275,7 @@ bool Query_log_event::write(IO_CACHE* fi
   {
     /* In the TZ sys table, column Name is of length 64 so this should be ok */
     DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH);
-    write_str_with_code_and_len((char **)(&start),
+    write_str_with_code_and_len(&start,
                                 time_zone_str, time_zone_len, Q_TIME_ZONE_CODE);
   }
   if (lc_time_names_number)

Thread
bzr commit into mysql-5.1-telco-6.2 branch (Martin.Skold:3052) Bug#49536Martin Skold15 Dec