diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc
index 0cfa8a4ecd0cc7111a41474a41bbbe623c5e3dad..d234fb2ab9cc8fbda68f2eeb0806c5b0dbb61bd3 100755
--- a/BUILD/compile-solaris-sparc
+++ b/BUILD/compile-solaris-sparc
@@ -5,5 +5,5 @@ aclocal; autoheader; aclocal; automake; autoconf
 
 CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -f
 elide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/m
-ysql --with-extra-charsets=complex
+ysql --with-extra-charsets=complex 
 gmake
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 527cd5becdea6301d47525f333dab9b4c830be42..d62fe95f1eaf3fdd61d277368d564521679ef4c7 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -61,7 +61,7 @@ if ($opt_stage == 0)
     log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown");
   }
   system("touch $host/mysql-fix-for-glob");
-  rm_all(<$host/mysql-*>);
+  rm_all(<$host/mysql-3*>);
   rm_all("$host/test");
   system("mkdir $host") if (! -d $host);
   system("mkdir $host/test") if (! -d "$host/test");
diff --git a/Makefile.am b/Makefile.am
index d5924439e7ce8932b841faa58112f1cf96608abb..cc8a387ca4f57eedd7980dc346e7871754a8fa21 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST =		INSTALL-SOURCE README \
 SUBDIRS =		include @docs_dirs@ @readline_dir@ \
 			@thread_dirs@ @sql_client_dirs@ \
 			@sql_server_dirs@ scripts tests man \
-			@bench_dirs@ support-files mysql-test
+			@bench_dirs@ support-files
 
 # Relink after clean
 CLEANFILES =		linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources linked_include_sources
diff --git a/configure.in b/configure.in
index 5cf616d95ebc8180f609c4dbdfbf3dfec3e0c911..00f8644f2693236e71d22f9b67007f8e47424a89 100644
--- a/configure.in
+++ b/configure.in
@@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT(sql/mysqld.cc)
 AC_CANONICAL_SYSTEM
 # The Docs Makefile.am parses this line!
-AM_INIT_AUTOMAKE(mysql, 3.23.29-gamma)
+AM_INIT_AUTOMAKE(mysql, 3.23.29a-gamma)
 AM_CONFIG_HEADER(config.h)
 
 PROTOCOL_VERSION=10
@@ -637,6 +637,20 @@ case $SYSTEM_TYPE in
     CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
     CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
     ;;
+  *solaris2.8*)
+    # Solaris 2.8 has a broken /usr/include/widec.h
+    # Make a fixed copy in ./include
+    echo "Fixing broken include files for $SYSTEM_TYPE"
+    echo "  - Creating local copy of widec.h"
+    if test ! -d include
+    then
+      mkdir ./include
+    fi
+    builddir=`pwd`
+    sed -e "s|^#if[ 	]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h
+    CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
+    CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T"
+    ;;
   *solaris2.5.1*)
     echo "Enabling getpass() workaround for Solaris 2.5.1"
     CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T";
@@ -1514,7 +1528,7 @@ AC_ARG_WITH(bench,
 
 if test "$with_bench" = "yes"
 then
-  bench_dirs="sql-bench"
+  bench_dirs="sql-bench mysql-test"
 else
   bench_dirs=""
 fi
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index cced1944d9eefbee2402fe3bba2b1813259e2a78..5b3347081c4282db273f4418010a75879b219656 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -43,7 +43,7 @@ EXTRA_SCRIPTS =		make_binary_distribution.sh \
 			mysql_find_rows.sh \
 			mysqlhotcopy.sh \
 		        mysqldumpslow.sh \
-			mysqld_multi \
+			mysqld_multi.sh \
 			safe_mysqld.sh
 
 EXTRA_DIST =		$(EXTRA_SCRIPTS) \
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 9c79ecea7359c26d4584e98822750d8fa51892b3..0065fdc6208bec8b463d75834580f2699b1bf15c 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -69,11 +69,11 @@ cp -r -p sql/share/* $BASE/share/mysql
 rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD
 rm -rf $BASE/share/SCCS  $BASE/share/*/SCCS 
 
-cp  -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/scripts
-cp -p mysql-test/README $BASE/README
+cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/
+cp -p mysql-test/README $BASE/mysql-test/README
 cp -p mysql-test/include/*.inc $BASE/mysql-test/include
 cp -p mysql-test/std_data/*.dat  mysql-test/std_data/*.frm \
- mysql-test/std_data/*.MRG  $BASE/mysql-test/std_data
+      mysql-test/std_data/*.MRG  $BASE/mysql-test/std_data
 cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t
 cp -p mysql-test/r/*.result  $BASE/mysql-test/r
 
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 1a29de32ed43d0292f98c8a6860930ee27ec4cb5..bd2e4ee92728602fdd1806b008ff24eaac07251b 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -93,7 +93,6 @@ u_int32_t berkeley_lock_types[]=
 { DB_LOCK_DEFAULT, DB_LOCK_OLDEST, DB_LOCK_RANDOM };
 TYPELIB berkeley_lock_typelib= {array_elements(berkeley_lock_names),"",
 				berkeley_lock_names};
-static MEM_ROOT show_logs_root;
 
 static void berkeley_print_error(const char *db_errpfx, char *buffer);
 static byte* bdb_get_key(BDB_SHARE *share,uint *length,
@@ -211,45 +210,51 @@ int berkeley_rollback(THD *thd, void *trans)
   DBUG_RETURN(error);
 }
 
-static void *show_logs_alloc(size_t size)
-{
-  return alloc_root(&show_logs_root, size);
-}
 
 int berkeley_show_logs(THD *thd)
 {
-  char **all_logs, **free_logs;
+  char **all_logs, **free_logs, **a, **f;
   String *packet= &thd->packet;
-  int error;
+  int error=1;
+  MEM_ROOT show_logs_root;
+  MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC);
   DBUG_ENTER("berkeley_show_logs");
 
   init_alloc_root(&show_logs_root, 1024, 1024);
-  if ((error= log_archive(db_env, &all_logs, DB_ARCH_ABS|DB_ARCH_LOG, show_logs_alloc)) ||
-      (error= log_archive(db_env, &free_logs, DB_ARCH_ABS, show_logs_alloc)))
+  my_pthread_setspecific_ptr(THR_MALLOC,&show_logs_root);
+
+  if ((error= log_archive(db_env, &all_logs, DB_ARCH_ABS | DB_ARCH_LOG,
+			  (void* (*)(unsigned int)) sql_alloc)) ||
+      (error= log_archive(db_env, &free_logs, DB_ARCH_ABS, 
+			  (void* (*)(unsigned int)) sql_alloc)))
   {
     DBUG_PRINT("error", ("log_archive failed (error %d)", error));
     db_env->err(db_env, error, "log_archive: DB_ARCH_ABS");
-    DBUG_RETURN(1);
+    goto err;
   }
 
-  for (char **a = all_logs, **f = free_logs; *a; ++a)
+  for (a = all_logs, f = free_logs; *a; ++a)
   {
     packet->length(0);
     net_store_data(packet,*a);
     net_store_data(packet,"BDB");
-    if (f && *f && strcmp(*a, *f) == 0)
+    if (*f && strcmp(*a, *f) == 0)
     {
-      net_store_data(packet, SHOW_LOG_STATUS_FREE);
       ++f;
+      net_store_data(packet, SHOW_LOG_STATUS_FREE);
     }
     else
       net_store_data(packet, SHOW_LOG_STATUS_INUSE);
 
     if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
-      DBUG_RETURN(1); /* purecov: inspected */
+      goto err;
   }
+  error=0;
+
+err:
   free_root(&show_logs_root,MYF(0));
-  DBUG_RETURN(0);
+  my_pthread_setspecific_ptr(THR_MALLOC,old_root);
+  DBUG_RETURN(error);
 }
 
 static void berkeley_print_error(const char *db_errpfx, char *buffer)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1f93e6baf67fff4fc3ebde7169cbfa5b858c5634..9c47a57b4389c61c9ad32eea7ffe468f5475ea15 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -635,7 +635,7 @@ void clean_up(void)
 static void set_ports()
 {
   char	*env;
-  if (!mysql_port)
+  if (!mysql_port && !opt_disable_networking)
   {					// Get port if not from commandline
     struct  servent *serv_ptr;
     mysql_port = MYSQL_PORT;