Subject: MySQL 3.23.35 and NetBSD/Alpha Solution
To: None <port-alpha@netbsd.org>
From: Caffeinate The World <mochaexpress@yahoo.com>
List: port-alpha
Date: 04/04/2001 19:51:23
I've been at this for months now. I've finally found a combination for
MySQL to work with my NetBSD/Alpha. 

WHAT DID NOT WORK

Please note, using the MIT-pthread derived thread implementation that
comes with MySQL will not work for the Alpha. I think the assembly
routines are dated. However it will work with i386. Compiling with PTL2
is fine. Daemon will run, but any access by clients will just stall.

WHAT WORKED

I tried using GNU's earlier versions with MySQL w/o success. I believe
i reported this a while back. But with release 1.4.0 of GNU Pth, I
decided to try again. Please note that the author of GNU Pth did get
earlier versions of Pth to work with MySQL but it was on FreeBSD i386
3.1.

Here are my notes to get things working. I've been running MySQL on a
heavily loaded server without a single core dump. I hope this is
benefitial for some of you.

---start notes---
##############################################################################
# MySQL 3.23.35 for NetBSD/Alpha-1.5S
# using GNU Pth 1.4.0 (/usr/local/install/pth-1.4.0)

Apply this diff in ./mysql-3.23.35/mysys:

---cut---
--- my_pthread.c.orig   Fri Mar 23 23:33:06 2001
+++ my_pthread.c        Fri Mar 23 23:52:11 2001
@@ -27,11 +27,20 @@
 #include <netdb.h>
 #endif

-#if (defined(__BSD__) || defined(_BSDI_VERSION)) &&
!defined(HAVE_mit_thread)
+#define SCHED_OTHER    0
+#define SCHED_FIFO     1
+#define SCHED_RR       2
+
+#if (defined(__NetBSD__) || defined(__BSD__) ||
defined(_BSDI_VERSION)) && !defined(HAVE_mit_thr
ead)
 #define SCHED_POLICY SCHED_RR
 #else
 #define SCHED_POLICY SCHED_OTHER
 #endif
+
+struct sched_param
+{
+  int sched_priority;     /* Process execution scheduling priority */
+};

 #ifndef my_pthread_setprio
 void my_pthread_setprio(pthread_t thread_id,int prior)
---/cut-- 
 
gmake distclean #(or gmake distclean to bring it back to a fresh start)
		
export CFLAGS="`pthread-config --cflags`"
export CXXFLAGS="`pthread-config --cflags`"
export LDFLAGS="`pthread-config --ldflags`"

./configure  \
--prefix=/usr/local/install/mysql-3.23.35 \
--localstatedir=/var/mysql \
--with-low-memory \
--with-named-curses=curses \
--with-gnu-ld \
--with-mysqld-ldflags="-lz -Wl,-R/usr/lib -L/usr/lib" \
--with-client-ldflags="-lz -Wl,-R/usr/lib -L/usr/lib" \
--with-named-z-libs=z \
--without-docs \
--without-bench \
--without-debug \
--without-perl \
--without-mit-threads \
--with-pthread \
--with-named-thread-libs="`pthread-config --libs`"

# --with-mysqld-ldflags=-all-static

gmake
gmake install
gmake distclean

NOTE: this actually worked. earlier versions of pth didn't work. 
mysql clients would lock up. 

---/end notes---

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/