From e07aa7950e26cfe322973e1690448046ec012b9f Mon Sep 17 00:00:00 2001 From: unknown <sasha@mysql.sashanet.com> Date: Sat, 4 Nov 2000 21:00:41 -0700 Subject: [PATCH] BitKeeper/triggers/post-commit send the diffs Docs/manual.texi updated change history include/my_sys.h Moved safemalloc_mem_limit here mysys/safemalloc.c fixed up safemalloc_mem_limit sql/mysqld.cc moved safemalloc_mem_limit declaration to my_sys.h BitKeeper/triggers/post-commit: send the diffs Docs/manual.texi: updated change history include/my_sys.h: Moved safemalloc_mem_limit here mysys/safemalloc.c: fixed up safemalloc_mem_limit sql/mysqld.cc: moved safemalloc_mem_limit declaration to my_sys.h --- BitKeeper/triggers/post-commit | 1 + Docs/manual.texi | 17 ++++++++++++++++- include/my_sys.h | 1 + mysys/safemalloc.c | 9 ++------- sql/mysqld.cc | 3 --- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index ed3b97c3130..68a2d0d42c5 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -15,6 +15,7 @@ Subject: bk commit EOF bk changes -v -r+ + bk cset -r+ -d ) | /usr/sbin/sendmail -t else echo "commit failed because '$BK_COMMIT', sorry life is hard..." diff --git a/Docs/manual.texi b/Docs/manual.texi index 9db9ace3b6c..7c7b7c9b78a 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -813,7 +813,7 @@ MySQL change history Changes in release 3.23.x (Recommended; beta) -* News-3.23.28:: +* News-3.23.28:: Changes in release 3.23.28 * News-3.23.27:: Changes in release 3.23.27 * News-3.23.26:: Changes in release 3.23.26 * News-3.23.25:: Changes in release 3.23.25 @@ -38293,6 +38293,21 @@ Fixed the output of @code{SHOW MASTER STATUS} to be consistent with Added @code{PURGE MASTER LOGS TO}. @item Added @code{SHOW MASTER LOGS}. +@item +Added @code{--safemalloc-mem-limit} option to mysqld to simulate memory +shortage when compiled @code{--with-debug=full} +@item +Fixed several coredumps in out-of-memory conditions +@item +@code{SHOW SLAVE STATUS} was using unititialized mutex if the slave had +not been started yet +@item +Fixed bug in @code{ELT()} and @code{MAKE_SET()} when the query used +a temporary table +@item +@code{CHANGE MASTER TO} without specifying @code{MASTER_LOG_POS} would +set it to 0 instead of 4 and hit the magic number in the master binlog. + @end itemize @node News-3.23.27, News-3.23.26, News-3.23.28, News-3.23.x diff --git a/include/my_sys.h b/include/my_sys.h index beee8e3dc1c..3fc4fed3397 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -120,6 +120,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #define QUICK_SAFEMALLOC sf_malloc_quick=1 #define NORMAL_SAFEMALLOC sf_malloc_quick=0 extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; +extern ulonglong safemalloc_mem_limit; #else #define my_checkmalloc() (0) #define TERMINATE(A) {} diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c index 589ed1c457b..34fcfff756c 100644 --- a/mysys/safemalloc.c +++ b/mysys/safemalloc.c @@ -73,9 +73,7 @@ #include "my_static.h" #include "mysys_err.h" -#ifndef DBUG_OFF -ulonglong safemalloc_mem_limit = 0; -#endif +ulonglong safemalloc_mem_limit = ~(ulonglong)0; #define pNext tInt._pNext #define pPrev tInt._pPrev @@ -133,12 +131,9 @@ gptr _mymalloc (uint uSize, const char *sFile, uint uLine, myf MyFlags) if (!sf_malloc_quick) (void) _sanity (sFile, uLine); -#ifndef DBUG_OFF - if(safemalloc_mem_limit && - uSize + lCurMemory > safemalloc_mem_limit) + if(uSize + lCurMemory > safemalloc_mem_limit) pTmp = 0; else -#endif /* Allocate the physical memory */ pTmp = (struct remember *) malloc ( sizeof (struct irem) /* remember data */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ede8f0e14a7..f571063a89d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -248,9 +248,6 @@ double log_10[32]; /* 10 potences */ I_List<THD> threads,thread_cache; time_t start_time; -#if !defined(DBUG_OFF) && defined(SAFEMALLOC) -extern ulonglong safemalloc_mem_limit; -#endif pthread_key(MEM_ROOT*,THR_MALLOC); pthread_key(THD*, THR_THD); -- 2.30.9