List:Commits« Previous MessageNext Message »
From:knielsen Date:May 16 2006 12:34pm
Subject:bk commit into 5.1 tree (knielsen:1.2400)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of knielsen. When knielsen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2400 06/05/16 14:34:35 knielsen@stripped +7 -0
  Merge mysql.com:/usr/local/mysql/mysql-5.0-vgfix
  into  mysql.com:/usr/local/mysql/tmp-5.1

  include/my_dbug.h
    1.21 06/05/16 14:34:28 knielsen@stripped +2 -2
    Manual merge

  dbug/dbug.c
    1.26 06/05/16 14:34:28 knielsen@stripped +20 -36
    Manual merge

  sql/mysqld.cc
    1.555 06/05/16 14:16:19 knielsen@stripped +0 -0
    Auto merged

  mysys/my_init.c
    1.50 06/05/16 14:16:19 knielsen@stripped +0 -0
    Auto merged

  libmysql/libmysql.c
    1.252 06/05/16 14:16:19 knielsen@stripped +0 -0
    Auto merged

  include/my_sys.h
    1.194 06/05/16 14:16:18 knielsen@stripped +0 -0
    Auto merged

  client/mysqlbinlog.cc
    1.129 06/05/16 14:16:18 knielsen@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	knielsen
# Host:	rt.int.sifira.dk
# Root:	/usr/local/mysql/tmp-5.1/RESYNC

--- 1.25/dbug/dbug.c	2006-04-20 03:05:35 +02:00
+++ 1.26/dbug/dbug.c	2006-05-16 14:34:28 +02:00
@@ -255,6 +255,8 @@
 static void DBUGCloseFile(CODE_STATE *cs, FILE *fp);
         /* Push current debug settings */
 static void PushState(CODE_STATE *cs);
+	/* Free memory associated with debug state. */
+static void FreeState (struct state *state);
         /* Test for tracing enabled */
 static BOOLEAN DoTrace(CODE_STATE *cs);
 
@@ -742,19 +744,7 @@
   if (discard->next != NULL)
   {
     cs->stack= discard->next;
-    if (!is_shared(discard, keywords))
-      FreeList(discard->keywords);
-    if (!is_shared(discard, functions))
-      FreeList(discard->functions);
-    if (!is_shared(discard, processes))
-      FreeList(discard->processes);
-    if (!is_shared(discard, p_functions))
-      FreeList(discard->p_functions);
-    if (!is_shared(discard, out_file))
-      DBUGCloseFile(cs, discard->out_file);
-    if (discard->prof_file)
-      DBUGCloseFile(cs, discard->prof_file);
-    free((char *) discard);
+    FreeState(discard);
   }
 }
 
@@ -1423,6 +1413,68 @@
   new_malloc->next= cs->stack;
   new_malloc->out_file= NULL;
   cs->stack= new_malloc;
+}
+
+/*
+ *  FUNCTION
+ *
+ *	FreeState    Free memory associated with a struct state.
+ *
+ *  SYNOPSIS
+ *
+ *	static void FreeState (state)
+ *	struct state *state;
+ *
+ *  DESCRIPTION
+ *
+ *	Deallocates the memory allocated for various information in a
+ *	state.
+ *
+ */
+static void FreeState (
+struct state *state)
+{
+  if (!is_shared(state, keywords))
+    FreeList(state->keywords);
+  if (!is_shared(state, functions))
+    FreeList(state->functions);
+  if (!is_shared(state, processes))
+    FreeList(state->processes);
+  if (!is_shared(state, p_functions))
+    FreeList(state->p_functions);
+  if (!is_shared(state, out_file))
+    DBUGCloseFile(cs, state->out_file);
+  if (state->prof_file)
+    DBUGCloseFile(cs, state->prof_file);
+  free((char *) state);
+}
+
+
+/*
+ *  FUNCTION
+ *
+ *	_db_end_    End debugging, freeing state stack memory.
+ *
+ *  SYNOPSIS
+ *
+ *	static VOID _db_end_ ()
+ *
+ *  DESCRIPTION
+ *
+ *	Ends debugging, de-allocating the memory allocated to the
+ *	state stack.
+ *
+ *	To be called at the very end of the program.
+ *
+ */
+void _db_end_ ()
+{
+  reg1 struct state *discard;
+  while((discard= stack) != NULL) {
+    stack= discard -> next_state;
+    FreeState (discard);
+  }
+  _db_on_=0;
 }
 
 

--- 1.20/include/my_dbug.h	2006-04-01 23:29:44 +02:00
+++ 1.21/include/my_dbug.h	2006-05-16 14:34:28 +02:00
@@ -42,6 +42,7 @@
 extern	void _db_doprnt_ _VARARGS((const char *format,...));
 extern	void _db_dump_(uint _line_,const char *keyword,const char *memory,
 		       uint length);
+extern	void _db_end_(void);
 extern	void _db_lock_file_(void);
 extern	void _db_unlock_file_(void);
 extern FILE *_db_fp_(void);
@@ -73,6 +74,7 @@
 #define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
 #define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
 #define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
+#define DBUG_END()  _db_end_ ()
 #define DBUG_LOCK_FILE _db_lock_file_()
 #define DBUG_UNLOCK_FILE _db_unlock_file_()
 #define DBUG_ASSERT(A) assert(A)
@@ -97,6 +99,7 @@
 #define DBUG_SETJMP(a1) setjmp(a1)
 #define DBUG_LONGJMP(a1) longjmp(a1)
 #define DBUG_DUMP(keyword,a1,a2)
+#define DBUG_END()
 #define DBUG_ASSERT(A)
 #define DBUG_LOCK_FILE
 #define DBUG_FILE (stderr)

--- 1.193/include/my_sys.h	2006-05-04 05:28:20 +02:00
+++ 1.194/include/my_sys.h	2006-05-16 14:16:18 +02:00
@@ -75,6 +75,7 @@
 
 #define MY_CHECK_ERROR	1	/* Params to my_end; Check open-close */
 #define MY_GIVE_INFO	2	/* Give time info about process*/
+#define MY_DONT_FREE_DBUG 4     /* Do not call DBUG_END() in my_end() */
 
 #define ME_HIGHBYTE	8	/* Shift for colours */
 #define ME_NOCUR	1	/* Don't use curses message */

--- 1.251/libmysql/libmysql.c	2006-05-12 08:42:00 +02:00
+++ 1.252/libmysql/libmysql.c	2006-05-16 14:16:19 +02:00
@@ -178,7 +178,7 @@
   /* If library called my_init(), free memory allocated by it */
   if (!org_my_init_done)
   {
-    my_end(0);
+    my_end(MY_DONT_FREE_DBUG);
   /* Remove TRACING, if enabled by mysql_debug() */
     DBUG_POP();
   }

--- 1.49/mysys/my_init.c	2006-05-04 05:28:20 +02:00
+++ 1.50/mysys/my_init.c	2006-05-16 14:16:19 +02:00
@@ -197,8 +197,10 @@
    _CrtDumpMemoryLeaks();
 #endif
   }
+
+  if (!(infoflag & MY_DONT_FREE_DBUG))
+    DBUG_END();                /* Must be done before my_thread_end */
 #ifdef THREAD
-  DBUG_POP();				/* Must be done before my_thread_end */
   my_thread_end();
   my_thread_global_end();
 #if defined(SAFE_MUTEX)

--- 1.128/client/mysqlbinlog.cc	2006-02-10 13:25:40 +01:00
+++ 1.129/client/mysqlbinlog.cc	2006-05-16 14:16:18 +02:00
@@ -815,7 +815,8 @@
   fprintf(stderr, "\n");
   va_end(args);
   cleanup();
-  my_end(0);
+  /* We cannot free DBUG, it is used in global destructors after exit(). */
+  my_end(MY_DONT_FREE_DBUG);
   exit(1);
 }
 
@@ -1487,7 +1488,8 @@
   cleanup();
   free_defaults(defaults_argv);
   my_free_open_file_info();
-  my_end(0);
+  /* We cannot free DBUG, it is used in global destructors after exit(). */
+  my_end(MY_DONT_FREE_DBUG);
   exit(exit_value);
   DBUG_RETURN(exit_value);			// Keep compilers happy
 }

--- 1.554/sql/mysqld.cc	2006-05-12 08:45:17 +02:00
+++ 1.555/sql/mysqld.cc	2006-05-16 14:16:19 +02:00
@@ -1075,6 +1075,10 @@
     pthread_join(select_thread, NULL);		// wait for main thread
 #endif /* __NETWARE__ */
 
+#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2))
+  my_thread_end();
+#endif
+
   pthread_exit(0);				/* purecov: deadcode */
 
 #endif /* EMBEDDED_LIBRARY */
Thread
bk commit into 5.1 tree (knielsen:1.2400)knielsen16 May