diff options
-rw-r--r-- | client/mysql.cc | 3 | ||||
-rw-r--r-- | configure.in | 17 | ||||
-rw-r--r-- | include/config-netware.h | 20 | ||||
-rw-r--r-- | include/my_global.h | 7 | ||||
-rw-r--r-- | include/my_pthread.h | 5 | ||||
-rw-r--r-- | mysys/my_pthread.c | 23 | ||||
-rwxr-xr-x | netware/BUILD/compile-AUTOTOOLS | 6 | ||||
-rwxr-xr-x | netware/BUILD/compile-linux-tools | 5 | ||||
-rwxr-xr-x | netware/BUILD/compile-netware-END | 8 | ||||
-rwxr-xr-x | netware/BUILD/compile-netware-START | 5 | ||||
-rwxr-xr-x | netware/BUILD/compile-netware-all | 7 | ||||
-rwxr-xr-x | netware/BUILD/compile-netware-debug | 6 | ||||
-rw-r--r-- | netware/BUILD/compile-netware-src | 36 | ||||
-rwxr-xr-x | netware/BUILD/compile-netware-standard | 9 | ||||
-rw-r--r-- | netware/BUILD/cron-build | 46 | ||||
-rw-r--r-- | netware/BUILD/crontab | 4 | ||||
-rw-r--r-- | netware/BUILD/knetware.imp | 2 | ||||
-rwxr-xr-x | netware/BUILD/mwasmnlm | 3 | ||||
-rwxr-xr-x | netware/BUILD/mwccnlm | 3 | ||||
-rwxr-xr-x | netware/BUILD/mwenv | 8 | ||||
-rwxr-xr-x | netware/BUILD/mwldnlm | 3 | ||||
-rwxr-xr-x | netware/BUILD/nwbootstrap | 25 | ||||
-rw-r--r-- | netware/Makefile.am | 41 | ||||
-rw-r--r-- | netware/mysql_test_run.c | 15 | ||||
-rw-r--r-- | scripts/make_binary_distribution.sh | 93 | ||||
-rw-r--r-- | sql/mysqld.cc | 9 | ||||
-rw-r--r-- | sql/slave.cc | 4 |
27 files changed, 336 insertions, 77 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 2623660033b..6ce7a3453da 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2780,6 +2780,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...) { va_list args; + NETWARE_YIELD va_start(args, fmt); (void) vfprintf(file, fmt, args); #ifdef OS2 @@ -2793,6 +2794,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...) void tee_fputs(const char *s, FILE *file) { + NETWARE_YIELD fputs(s, file); #ifdef OS2 fflush( file); @@ -2804,6 +2806,7 @@ void tee_fputs(const char *s, FILE *file) void tee_puts(const char *s, FILE *file) { + NETWARE_YIELD fputs(s, file); fputs("\n", file); #ifdef OS2 diff --git a/configure.in b/configure.in index 4603e1fc9c4..5527c78124a 100644 --- a/configure.in +++ b/configure.in @@ -36,7 +36,7 @@ for i in $AVAILABLE_LANGUAGES do AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys" case $host_os in - netware* | modesto*) + netware*) echo "$i/errmsg.sys: $i/errmsg.txt \$(top_builddir)/extra/comp_err.linux \$^ $i/errmsg.sys" \ >> $AVAILABLE_LANGUAGES_ERRORS_RULES @@ -458,7 +458,7 @@ else *cygwin*) FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null" ;; - *netware* | *modesto*) + *netware*) FIND_PROC= ;; *) @@ -1533,7 +1533,7 @@ AC_SUBST(LIBDL) # System characteristics case $SYSTEM_TYPE in - *netware* | *modesto*) ;; + *netware*) ;; *) AC_SYS_RESTARTABLE_SYSCALLS ;; @@ -1563,10 +1563,12 @@ else fi if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then - DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG -sym internal,codeview4" - DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -DDEBUG -sym internal,codeview4" - OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -DNDEBUG" - OPTIMIZE_CXXFLAGS="$OPTIMIZE_CXXFLAGS -DNDEBUG" + DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4" + DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4" + DEBUG_OPTIMIZE_CC="-DDEBUG" + DEBUG_OPTIMIZE_CXX="-DDEBUG" + OPTIMIZE_CFLAGS="-O3 -DNDEBUG" + OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG" fi AC_ARG_WITH(debug, @@ -2661,6 +2663,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl tests/Makefile Docs/Makefile support-files/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl + netware/Makefile dnl include/mysql_version.h dnl , , [ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h diff --git a/include/config-netware.h b/include/config-netware.h index dab365a7127..6a7f6291e26 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -14,7 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Defines for netware compatible with MySQL */ +/* Header for NetWare compatible with MySQL */ + +#ifndef _config_netware_h +#define _config_netware_h /* required headers */ #include <unistd.h> @@ -32,6 +35,10 @@ #include <pthread.h> #include <termios.h> +#ifdef __cplusplus +extern "C" { +#endif + /* required adjustments */ #undef HAVE_READDIR_R #undef HAVE_RWLOCK_INIT @@ -80,6 +87,15 @@ /* do not use the extended time in LibC sys\stat.h */ #define _POSIX_SOURCE -/* Some macros for portability */ +/* kernal call on NetWare that will only yield if our time slice is up */ +void kYieldIfTimeSliceUp(void); +/* some macros for portability */ #define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; } + +#ifdef __cplusplus +} +#endif + +#endif /* _config_netware_h */ + diff --git a/include/my_global.h b/include/my_global.h index 510de43c9ee..8440830a342 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -69,6 +69,13 @@ #endif #endif /* _WIN32... */ +/* extra protection against CPU Hogs on NetWare */ +#ifdef __NETWARE__ + #define NETWARE_YIELD { kYieldIfTimeSliceUp(); } +#else + #define NETWARE_YIELD { } +#endif + /* The macros below are borrowed from include/linux/compiler.h in the Linux kernel. Use them to indicate the likelyhood of the truthfulness diff --git a/include/my_pthread.h b/include/my_pthread.h index 58f89517679..bff82ef7320 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -248,6 +248,11 @@ extern int my_sigwait(const sigset_t *set,int *sig); #error Requires at least rev 2 of EMX pthreads library. #endif +#ifdef __NETWARE__ +void my_pthread_exit(void *status); +#define pthread_exit(A) my_pthread_exit(A) +#endif + extern int my_pthread_getprio(pthread_t thread_id); #define pthread_key(T,V) pthread_key_t V diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index 1eb15d92bc9..f88a884a1bc 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -90,6 +90,29 @@ void *my_pthread_getspecific_imp(pthread_key_t key) } #endif +#ifdef __NETWARE__ +/* +don't kill the LibC Reaper thread or the main thread +*/ +#include <nks/thread.h> +void my_pthread_exit(void *status) +{ +#undef pthread_exit + NXThreadId_t tid = NXThreadGetId(); + NXContext_t ctx; + char name[PATH_MAX] = ""; + + NXThreadGetContext(tid, &ctx); + NXContextGetName(ctx, name, PATH_MAX); + + // "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" + // with a debug build of LibC the reaper can have different names + if (!strindex(name, "\'s")) + { + pthread_exit(status); + } +} +#endif /* Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 (and DEC OSF/1 3.2 too) */ diff --git a/netware/BUILD/compile-AUTOTOOLS b/netware/BUILD/compile-AUTOTOOLS index 0688ea5aaca..57213b1b3d0 100755 --- a/netware/BUILD/compile-AUTOTOOLS +++ b/netware/BUILD/compile-AUTOTOOLS @@ -1,5 +1,11 @@ #! /bin/sh +# debug +#set -x + +# stop on errors +set -e + for package in . ./innobase do (cd $package diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index 598be96ab66..3590a900338 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -1,8 +1,11 @@ #! /bin/sh -#debug +# debug #set -x +# stop on errors +set -e + if test ! -r ./sql/mysqld.cc then echo "you must start from the top source directory" diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END index beb15fbeda3..19d24ff8c6f 100755 --- a/netware/BUILD/compile-netware-END +++ b/netware/BUILD/compile-netware-END @@ -1,5 +1,11 @@ #! /bin/sh +# debug +#set -x + +# stop on errors +set -e + path=`dirname $0` # clean @@ -23,7 +29,7 @@ rm -rf Makefile.in.bk make clean bin-dist # mark the build -for file in *.tar.gz +for file in *.tar.gz *.zip do if (expr "$file" : "mysql-[1-9].*" > /dev/null) then diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START index 2941d8868e4..7eef192a907 100755 --- a/netware/BUILD/compile-netware-START +++ b/netware/BUILD/compile-netware-START @@ -1,8 +1,11 @@ #! /bin/sh -#debug +# debug #set -x +# stop on errors +set -e + if test ! -r ./sql/mysqld.cc then echo "you must start from the top source directory" diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all index f8dea0f7583..6baff699e94 100755 --- a/netware/BUILD/compile-netware-all +++ b/netware/BUILD/compile-netware-all @@ -1,7 +1,14 @@ #! /bin/sh +# debug +#set -x + +# stop on errors +set -e + path=`dirname $0` +$path/compile-netware-src $path/compile-netware-standard $path/compile-netware-debug #$path/compile-netware-max diff --git a/netware/BUILD/compile-netware-debug b/netware/BUILD/compile-netware-debug index 2cd292c82fd..e44d64e3074 100755 --- a/netware/BUILD/compile-netware-debug +++ b/netware/BUILD/compile-netware-debug @@ -1,5 +1,11 @@ #! /bin/sh +# debug +#set -x + +# stop on errors +set -e + path=`dirname $0` . $path/compile-netware-START diff --git a/netware/BUILD/compile-netware-src b/netware/BUILD/compile-netware-src new file mode 100644 index 00000000000..df7f6fcdd1a --- /dev/null +++ b/netware/BUILD/compile-netware-src @@ -0,0 +1,36 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + +if test ! -r ./sql/mysqld.cc +then + echo "you must start from the top source directory" + exit 1 +fi + +path=`dirname $0` + +# clean +if test -e "Makefile"; then + make -k clean; + make -k distclean; +fi + +# remove other files +rm -f NEW-RPMS/* +rm -f */.deps/*.P +rm -rf Makefile.in.bk + +# zip source +files=`pwd | sed -e "s/.*\\\(mysql-.*\)/\1/"` +file=`pwd | sed -e "s/.*\\mysql-\(.*\)/mysql-src-\1-pc-netware-i686/"` +cd .. +if test -e "$file.zip"; then rm -f $file.zip; fi +zip -r $file.zip $files -x \*.zip -x \*.tar.gz +if test -e "./$files/$file.zip"; then mv -f ./$files/$file.zip ./$files/$file.zip.old; fi +mv -f $file.zip ./$files/$file.zip + diff --git a/netware/BUILD/compile-netware-standard b/netware/BUILD/compile-netware-standard index c09337b5fe0..45f5021862c 100755 --- a/netware/BUILD/compile-netware-standard +++ b/netware/BUILD/compile-netware-standard @@ -1,12 +1,19 @@ #! /bin/sh +# debug +#set -x + +# stop on errors +set -e + + path=`dirname $0` . $path/compile-netware-START suffix="standard" extra_configs=" \ - --with-innodb + --with-innodb \ " . $path/compile-netware-END diff --git a/netware/BUILD/cron-build b/netware/BUILD/cron-build new file mode 100644 index 00000000000..26ccde28e2a --- /dev/null +++ b/netware/BUILD/cron-build @@ -0,0 +1,46 @@ +#! /bin/sh + +# debug +#set -x + +# stop on errors +set -e + +# repository direcotry +repo_dir=`pwd` + +# show usage +show_usage() +{ + cat << EOF + +usage: cron-patch + +EOF + exit 0; +} + +echo "starting build..." + +# check for bk and repo_dir +bk help > /dev/null +repo_dir=`bk root $repo_dir` +cd $repo_dir + +# pull latest code +echo 'y' | bk pull + +# determine version +version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"` +echo "version: $version" + +# latest revision +rev=`bk changes -e -n -d':REV:' | head -1` +echo "latest revision: $rev" + +# run bootstrap +./netware/BUILD/nwbootstrap --revision=$rev --suffix=$rev --build=all + +echo "done" + + diff --git a/netware/BUILD/crontab b/netware/BUILD/crontab new file mode 100644 index 00000000000..0097f8acaaf --- /dev/null +++ b/netware/BUILD/crontab @@ -0,0 +1,4 @@ +00 23 * * * (export PATH='/usr/local/bin:/usr/bin:/bin'; export DISPLAY=':0'; cd ~/bk/mysqldoc; echo 'y' | bk pull) +00 00 * * * (export PATH='/usr/local/bin:/usr/bin:/bin'; export DISPLAY=':0'; cd ~/bk/mysql-4.0; ./netware/BUILD/cron-build) +00 04 * * * (export PATH='/usr/local/bin:/usr/bin:/bin'; export DISPLAY=':0'; cd ~/bk/mysql-4.1; ./netware/BUILD/cron-build) + diff --git a/netware/BUILD/knetware.imp b/netware/BUILD/knetware.imp new file mode 100644 index 00000000000..d9a9372b34f --- /dev/null +++ b/netware/BUILD/knetware.imp @@ -0,0 +1,2 @@ +kYieldIfTimeSliceUp + diff --git a/netware/BUILD/mwasmnlm b/netware/BUILD/mwasmnlm index c3501112aa5..381f84ec0c8 100755 --- a/netware/BUILD/mwasmnlm +++ b/netware/BUILD/mwasmnlm @@ -1,5 +1,8 @@ #! /bin/sh +# stop on errors +set -e + args=" $*" wine --debugmsg -all -- mwasmnlm $args diff --git a/netware/BUILD/mwccnlm b/netware/BUILD/mwccnlm index 9e989485bd9..cb2d62fe8cf 100755 --- a/netware/BUILD/mwccnlm +++ b/netware/BUILD/mwccnlm @@ -1,5 +1,8 @@ #! /bin/sh +# stop on errors +set -e + # mwccnlm is having a hard time understanding "-I./../include" # convert it to "-I../include" args=" "`echo $* | sed -e 's/-I.\/../-I../g'` diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index 27f7056d251..4445bc5b2e5 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -7,8 +7,8 @@ export MYDEV="WINE_BUILD_DIR" export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4" -export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4" -export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a" +export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/mysql-VERSION/netware/BUILD;$MYDEV/zlib-1.1.4" +export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;knetware.imp;libz.a" export WINEPATH="$MYDEV/mw/bin" @@ -19,9 +19,9 @@ export AR='mwldnlm' export AR_FLAGS='-type library -o' export AS='mwasmnlm' export CC='mwccnlm -gccincludes' -export CFLAGS='-dialect c -proc 686 -relax_pointers' +export CFLAGS='-align 8 -proc 686 -relax_pointers -dialect c' export CXX='mwccnlm -gccincludes' -export CXXFLAGS='-dialect c++ -proc 686 -bool on -wchar_t on -relax_pointers -D_WCHAR_T' +export CXXFLAGS='-align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T' export LD='mwldnlm' export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption' export RANLIB=: diff --git a/netware/BUILD/mwldnlm b/netware/BUILD/mwldnlm index 7ad2872ccbb..28566fc5cb1 100755 --- a/netware/BUILD/mwldnlm +++ b/netware/BUILD/mwldnlm @@ -1,5 +1,8 @@ #! /bin/sh +# stop on errors +set -e + args=" $*" wine --debugmsg -all -- mwldnlm $args diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 002e19c8e49..43b61d5254d 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -3,11 +3,11 @@ # debug #set -x -path=`dirname $0` - # stop on errors set -e +path=`dirname $0` + # repository direcotry repo_dir=`pwd` @@ -24,6 +24,7 @@ temp_dir="" revision="" rev="" build="" +suffix="" mwenv="" # show usage @@ -81,6 +82,7 @@ for arg do --wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;; --revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;; --build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;; + --suffix=*) suffix=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;; *) show_usage ;; esac @@ -111,6 +113,12 @@ echo "version: $version" # build target directory target_dir="$build_dir/mysql-$version" +# add suffix +if test $suffix +then + target_dir="$target_dir-$suffix" +fi + # delete any old target if test -d $target_dir.old; then rm -rf $target_dir.old; fi @@ -139,10 +147,12 @@ then fi # make files writeable +echo "making files writable..." cd $target_dir chmod -R u+rw,g+rw . # edit the mvenv file +echo "updating the mwenv environment file..." mwenv="./netware/BUILD/mwenv" mv -f $mwenv $mwenv.org sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \ @@ -150,6 +160,17 @@ sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \ -e "s;VERSION;$version;g" $mwenv.org > $mwenv chmod +rwx $mwenv +#edit the def file versions +echo "updating *.def file versions..." +nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"` + +for file in ./netware/*.def +do +mv -f $file $file.org +sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file +rm $file.org +done + # build linux tools echo "compiling linux tools..." ./netware/BUILD/compile-linux-tools diff --git a/netware/Makefile.am b/netware/Makefile.am index 6495f538ffb..e4b9a14ecf0 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -14,35 +14,34 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCLUDES = -I$(srcdir)/../include -I../include -I.. -bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql -mysqld_safe_SOURCES= mysqld_safe.c my_manage.c +INCLUDES= -I$(srcdir)/../include -I../include -I.. +bin_PROGRAMS= mysqld_safe mysql_install_db mysql_test_run libmysql +mysqld_safe_SOURCES= mysqld_safe.c my_manage.c mysql_install_db_SOURCES= mysql_install_db.c my_manage.c mysql_test_run_SOURCES= mysql_test_run.c my_manage.c -libmysql_SOURCES= libmysqlmain.c -libmysql_LDADD = ../libmysql/.libs/libmysqlclient.a +libmysql_SOURCES= libmysqlmain.c +libmysql_LDADD= ../libmysql/.libs/libmysqlclient.a -netware_build_files = client/mysql.def client/mysqladmin.def \ - client/mysqlbinlog.def client/mysqlcheck.def \ - client/mysqldump.def client/mysqlimport.def \ - client/mysqlshow.def client/mysqltest.def \ - extra/mysql_install.def extra/my_print_defaults.def \ - extra/perror.def extra/replace.def \ - extra/resolveip.def extra/comp_err.def \ - isam/isamchk.def \ - isam/isamlog.def isam/pack_isam.def \ - libmysqld/libmysqld.def myisam/myisamchk.def \ - myisam/myisamlog.def myisam/myisampack.def \ - sql/mysqld.def +netware_build_files = client/mysql.def client/mysqladmin.def \ + client/mysqlbinlog.def client/mysqlcheck.def \ + client/mysqldump.def client/mysqlimport.def \ + client/mysqlshow.def client/mysqltest.def \ + extra/mysql_install.def extra/my_print_defaults.def \ + extra/perror.def extra/replace.def \ + extra/resolveip.def extra/comp_err.def \ + isam/isamchk.def \ + isam/isamlog.def isam/pack_isam.def \ + libmysqld/libmysqld.def myisam/myisamchk.def \ + myisam/myisamlog.def myisam/myisampack.def \ + sql/mysqld.def link_sources: set -x; \ for f in $(netware_build_files); do \ - rm -f $(srcdir)/../$$f; \ - org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \ - @LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \ + rm -f $(srcdir)/../$$f; \ + org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \ + @LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \ done; - # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index ff629546793..8bf0b7e0016 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -266,6 +266,7 @@ void start_master() int err, i; char master_out[PATH_MAX]; char master_err[PATH_MAX]; + char temp[PATH_MAX]; // remove old berkeley db log files that can confuse the server removef("%s/log.*", master_dir); @@ -289,6 +290,20 @@ void start_master() if (master_init_script[0] != NULL) { // run_init_script(master_init_script); + + // TODO: use the scripts + if (strindex(master_init_script, "repair_part2-master.sh") != NULL) + { + FILE *fp; + + // create an empty index file + snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); + fp = fopen(temp, "wb+"); + + fputs("1", fp); + + fclose(fp); + } } // redirection files diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1731a7555e0..7e96c90905c 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -73,9 +73,25 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ - MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ - LICENSE.doc README.NW Docs/mysqlbug.txt +# Non platform-specific doc files: +DOC_FILES=" \ + ChangeLog COPYING COPYING.LIB README \ + Docs/manual.html Docs/manual.txt Docs/manual_toc.html \ + Docs/mysqlbug.txt \ +"; + +# Platform-specific doc files: +if [ $BASE_SYSTEM = "netware" ] ; then + DOC_FILES="$DOC_FILES \ + "; +# For all other platforms: +else + DOC_FILES="$DOC_FILES \ + Docs/INSTALL-BINARY MySQLEULA.txt \ + "; +fi + +for i in $DOC_FILES do if [ -f $i ] then @@ -83,7 +99,7 @@ do fi done -# Non platform-specific bin dir files: +# Non platform-specific bin files: BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ @@ -93,18 +109,18 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS + client/mysqlbinlog$BS \ "; -# Platform-specific bin dir files: +# Platform-specific bin files: if [ $BASE_SYSTEM = "netware" ] ; then BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ - netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql + netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; +# For all other platforms: else - # For all other platforms: BIN_FILES="$BIN_FILES \ client/mysqlmanagerc \ client/mysqlmanager-pwgen tools/mysqlmanager \ @@ -224,7 +240,9 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Make safe_mysqld a symlink to mysqld_safe for backwards portability # To be removed in MySQL 4.1 -(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +if [ $BASE_SYSTEM != "netware" ] ; then + (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) +fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then @@ -283,29 +301,48 @@ which_1 () exit 1 } -# -# Create the result tar file -# - -tar=`which_1 gnutar gtar` -if test "$?" = "1" -o "$tar" = "" -then - tar=tar -fi - -echo "Using $tar to create archive" cd $TMP + +if [ $BASE_SYSTEM = "netware" ] ; then + + # + # Create a zip file for NetWare users + # + + if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi + zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + echo "$NEW_NAME.zip created" + +else + + # + # Create the result tar file + # + + tar=`which_1 gnutar gtar` + if test "$?" = "1" -o "$tar" = "" + then + tar=tar + fi + + echo "Using $tar to create archive" + + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME + cd $SOURCE + + echo "Compressing archive" + gzip -9 $NEW_NAME.tar + + echo "$NEW_NAME.tar.gz created" -OPT=cvf -if [ x$SILENT = x1 ] ; then - OPT=cf fi -$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME -cd $SOURCE -echo "Compressing archive" -gzip -9 $NEW_NAME.tar echo "Removing temporary directory" rm -r -f $BASE -echo "$NEW_NAME.tar.gz created" + diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 32ab02807b9..f356a5135ee 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -825,11 +825,12 @@ static void __cdecl kill_server(int sig_ptr) unireg_abort(1); /* purecov: inspected */ else unireg_end(); + #ifdef __NETWARE__ pthread_join(select_thread, NULL); // wait for main thread -#else - pthread_exit(0); /* purecov: deadcode */ #endif /* __NETWARE__ */ + + pthread_exit(0); /* purecov: deadcode */ #endif /* EMBEDDED_LIBRARY */ RETURN_FROM_KILL_SERVER; @@ -887,13 +888,11 @@ void unireg_end(void) { clean_up(1); my_thread_end(); -#ifndef __NETWARE__ -#ifdef SIGNALS_DONT_BREAK_READ +#if defined(SIGNALS_DONT_BREAK_READ) && !defined(__NETWARE__) exit(0); #else pthread_exit(0); // Exit is in main thread #endif -#endif /* __NETWARE__ */ } diff --git a/sql/slave.cc b/sql/slave.cc index 1c5ad681153..9e8fb90c066 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2429,9 +2429,7 @@ err: goto slave_begin; #endif my_thread_end(); -#ifndef __NETWARE__ pthread_exit(0); -#endif /* __NETWARE__ */ DBUG_RETURN(0); // Can't return anything here } @@ -2573,9 +2571,7 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ goto slave_begin; #endif my_thread_end(); -#ifndef __NETWARE__ pthread_exit(0); -#endif /* __NETWARE__ */ DBUG_RETURN(0); // Can't return anything here } |