summaryrefslogtreecommitdiff
path: root/netware
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-15 10:47:50 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-15 10:47:50 -0300
commit649390ac814ce5ea1e77b833ab5fe92dfcfe86d5 (patch)
treeac8b15ac65b08a492c256369b73e372f6568c7a4 /netware
parent06b8897e8e9a27b6ffc562af90153ab63f30e63e (diff)
parent8df20918d6751dc1eeb47ab722269dbd9d2da297 (diff)
downloadmariadb-git-649390ac814ce5ea1e77b833ab5fe92dfcfe86d5.tar.gz
Merge of mysql-trunk-bugfixing into mysql-trunk-merge.
Diffstat (limited to 'netware')
-rwxr-xr-xnetware/BUILD/apply-patch41
-rwxr-xr-xnetware/BUILD/compile-AUTOTOOLS26
-rwxr-xr-xnetware/BUILD/compile-linux-tools67
-rwxr-xr-xnetware/BUILD/compile-netware-END52
-rwxr-xr-xnetware/BUILD/compile-netware-START26
-rwxr-xr-xnetware/BUILD/compile-netware-all15
-rwxr-xr-xnetware/BUILD/compile-netware-debug21
-rwxr-xr-xnetware/BUILD/compile-netware-max23
-rwxr-xr-xnetware/BUILD/compile-netware-max-debug23
-rwxr-xr-xnetware/BUILD/compile-netware-src35
-rwxr-xr-xnetware/BUILD/compile-netware-standard23
-rwxr-xr-xnetware/BUILD/create-patch56
-rwxr-xr-xnetware/BUILD/cron-build46
-rwxr-xr-xnetware/BUILD/crontab4
-rw-r--r--netware/BUILD/knetware.imp2
-rwxr-xr-xnetware/BUILD/mwasmnlm11
-rwxr-xr-xnetware/BUILD/mwccnlm16
-rwxr-xr-xnetware/BUILD/mwenv75
-rwxr-xr-xnetware/BUILD/mwldnlm18
-rwxr-xr-xnetware/BUILD/nwbuild86
-rw-r--r--netware/BUILD/openssl.imp9
-rwxr-xr-xnetware/BUILD/save-patch56
-rw-r--r--netware/Makefile.am117
-rw-r--r--netware/comp_err.def11
-rw-r--r--netware/install_test_db.ncf1
-rw-r--r--netware/libmysql.def12
-rw-r--r--netware/libmysqlmain.c38
-rw-r--r--netware/my_manage.c475
-rw-r--r--netware/my_manage.h118
-rw-r--r--netware/my_print_defaults.def11
-rw-r--r--netware/myisam_ftdump.def12
-rw-r--r--netware/myisamchk.def12
-rw-r--r--netware/myisamlog.def12
-rw-r--r--netware/myisampack.def12
-rw-r--r--netware/mysql.def13
-rw-r--r--netware/mysql.xdcbin128 -> 0 bytes
-rw-r--r--netware/mysql_client_test.def10
-rw-r--r--netware/mysql_fix_privilege_tables.pl227
-rw-r--r--netware/mysql_install_db.c447
-rw-r--r--netware/mysql_install_db.def12
-rw-r--r--netware/mysql_secure_installation.pl218
-rw-r--r--netware/mysql_test_run.c1415
-rw-r--r--netware/mysql_test_run.def11
-rw-r--r--netware/mysql_upgrade.def11
-rw-r--r--netware/mysql_waitpid.def12
-rw-r--r--netware/mysqladmin.def12
-rw-r--r--netware/mysqlbinlog.def12
-rw-r--r--netware/mysqlcheck.def12
-rw-r--r--netware/mysqld.def12
-rw-r--r--netware/mysqld_safe.c726
-rw-r--r--netware/mysqld_safe.def13
-rw-r--r--netware/mysqldump.def12
-rw-r--r--netware/mysqlimport.def12
-rw-r--r--netware/mysqlshow.def12
-rw-r--r--netware/mysqlslap.def11
-rw-r--r--netware/mysqltest.def11
-rw-r--r--netware/perror.def11
-rw-r--r--netware/replace.def11
-rw-r--r--netware/resolve_stack_dump.def12
-rw-r--r--netware/resolveip.def11
-rw-r--r--netware/static_init_db.sql34
61 files changed, 0 insertions, 4862 deletions
diff --git a/netware/BUILD/apply-patch b/netware/BUILD/apply-patch
deleted file mode 100755
index 3fe5a077f9a..00000000000
--- a/netware/BUILD/apply-patch
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-# repository directory
-repo_dir=`pwd`
-
-# show usage
-show_usage()
-{
- cat << EOF
-
-usage: apply-patch
-
-Imports netware/current-changes.patch so that current changes
-for the platform are present on the local repository.
-
-Use from the root directory of the repository, with BitKeeper
-installed.
-
-EOF
- exit 0;
-}
-
-if test $1 || test -z $BK_USER
-then
- show_usage
-fi
-
-echo "starting patch..."
-
-echo "user: $BK_USER"
-
-# import patch
-# Note: In future this should be changed to check whether
-# the repo already has this patch
-bk import -tpatch $repo_dir/netware/current-changes.patch $repo_dir
diff --git a/netware/BUILD/compile-AUTOTOOLS b/netware/BUILD/compile-AUTOTOOLS
deleted file mode 100755
index c93fb1b1b28..00000000000
--- a/netware/BUILD/compile-AUTOTOOLS
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-sed -e "s/^DIST_COMMON/#DIST_COMMON/g" storage/ndb/Makefile.am > storage/ndb/Makefile.am.$$
-mv storage/ndb/Makefile.am.$$ storage/ndb/Makefile.am
-
-# for package in . ./storage/innobase
-for package in .
-do
- (cd $package
- rm -rf config.cache autom4te.cache
- aclocal
- autoheader
- libtoolize --force
- aclocal
-# automake --verbose --add-missing --force-missing
- automake --add-missing --force-missing
- autoconf)
-done
-
-#rm -rf ./bdb/build_unix/config.cache ./bdb/dist/autom4te.cache
-#(cd ./bdb/dist && sh s_all)
diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools
deleted file mode 100755
index 6a6abd32639..00000000000
--- a/netware/BUILD/compile-linux-tools
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /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; fi
-
-# remove files
-rm -f */.deps/*.P
-rm -f */*.linux
-
-# run autotools
-. $path/compile-AUTOTOOLS
-
-# configure
-./configure --without-innodb --without-docs
-
-# build tools only
-make clean
-make
-
-# Create mysql_version.h which was deleted my previous step
-./config.status include/mysql_version.h
-
-(cd dbug; make libdbug.a)
-(cd strings; make libmystrings.a)
-(cd mysys; make libmysys.a)
-(cd storage/heap; make libheap.a)
-(cd vio; make libvio.a)
-(cd regex; make libregex.a)
-(cd storage/myisam; make libmyisam.a)
-(cd storage/myisammrg; make libmyisammrg.a)
-(cd extra; make comp_err)
-(cd libmysql; make conf_to_src)
-(cd libmysql_r; make conf_to_src)
-# so the file will be linked
-(cd sql; make sql_yacc.cc)
-(cd sql; make gen_lex_hash)
-(cd strings; make conf_to_src)
-
-# so the file will be linked
-(cd sql; make sql_yacc.cc)
-
-# we need initilizing SQL files.
-(cd netware; make test_db.sql init_db.sql)
-
-# copying required linux tools
-cp extra/comp_err extra/comp_err.linux
-cp libmysql/conf_to_src libmysql/conf_to_src.linux
-#cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux
-cp sql/gen_lex_hash sql/gen_lex_hash.linux
-cp strings/conf_to_src strings/conf_to_src.linux
-
-# Delete mysql_version.h
-rm -f include/mysql_version.h
diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END
deleted file mode 100755
index bf712f09162..00000000000
--- a/netware/BUILD/compile-netware-END
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-path=`dirname $0`
-
-# clean
-if test -e "Makefile"; then make -k clean; fi
-
-# remove files
-rm -f */.deps/*.P
-rm -rf Makefile.in.bk
-
-# Setup Metrowerks environment
-. $path/mwenv
-
-# Temporary hack to allow building from source dist
-if [ ! "$USER"=pushbuild ]
-then
- # Run autotools(use BUILD/autorun.sh)
- echo "Running autotools again(BUILD/autorun.sh)"
- . BUILD/autorun.sh
-fi
-
-# configure
-./configure $base_configs $extra_configs
-
-# Ensure a clean tree
-make clean
-
-# Link NetWare specific .def files into their proper locations
-# in the source tree
-( cd netware && make link_sources )
-
-# Now, do the real build
-make bin-dist
-
-# mark the build
-for file in *.tar.gz *.zip
-do
- if (expr "$file" : "mysql-[1-9].*" > /dev/null)
- then
- new_file=`echo $file | sed -e "s/mysql-/mysql-$suffix-/"`
- if test -e "$new_file"; then mv -f $new_file $new_file.old; fi
- mv $file $new_file
- fi
-done
-
diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START
deleted file mode 100755
index 414d577130e..00000000000
--- a/netware/BUILD/compile-netware-START
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /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`
-
-# stop on errors
-set -e
-
-base_configs=" \
- --host=i686-pc-netware \
- --enable-local-infile \
- --with-extra-charsets=all \
- --prefix=N:/mysql \
- --without-man \
- "
diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all
deleted file mode 100755
index dbe64e8f97e..00000000000
--- a/netware/BUILD/compile-netware-all
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /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
-$path/compile-netware-max-debug
diff --git a/netware/BUILD/compile-netware-debug b/netware/BUILD/compile-netware-debug
deleted file mode 100755
index e44d64e3074..00000000000
--- a/netware/BUILD/compile-netware-debug
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-path=`dirname $0`
-. $path/compile-netware-START
-
-suffix="debug"
-
-extra_configs=" \
- --with-innodb \
- --with-debug=full \
- "
-
-. $path/compile-netware-END
-
-
diff --git a/netware/BUILD/compile-netware-max b/netware/BUILD/compile-netware-max
deleted file mode 100755
index d8278a4e915..00000000000
--- a/netware/BUILD/compile-netware-max
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-
-path=`dirname $0`
-. $path/compile-netware-START
-
-suffix="max"
-
-extra_configs=" \
- --with-innodb \
- --with-embedded-server \
- --with-ssl \
- "
-
-. $path/compile-netware-END
-
-
diff --git a/netware/BUILD/compile-netware-max-debug b/netware/BUILD/compile-netware-max-debug
deleted file mode 100755
index de1b5dd17cc..00000000000
--- a/netware/BUILD/compile-netware-max-debug
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-path=`dirname $0`
-. $path/compile-netware-START
-
-suffix="max-debug"
-
-extra_configs=" \
- --with-innodb \
- --with-debug=full \
- --with-embedded-server \
- --with-ssl \
- "
-
-. $path/compile-netware-END
-
-
diff --git a/netware/BUILD/compile-netware-src b/netware/BUILD/compile-netware-src
deleted file mode 100755
index f4e8a53ffea..00000000000
--- a/netware/BUILD/compile-netware-src
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /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 */.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
deleted file mode 100755
index 76a776a1da3..00000000000
--- a/netware/BUILD/compile-netware-standard
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-
-path=`dirname $0`
-. $path/compile-netware-START
-
-suffix="standard"
-
-extra_configs=" \
- --with-innodb \
- --enable-thread-safe-client \
- --with-archive-storage-engine \
- "
-
-. $path/compile-netware-END
-
-
diff --git a/netware/BUILD/create-patch b/netware/BUILD/create-patch
deleted file mode 100755
index 711eabf2d89..00000000000
--- a/netware/BUILD/create-patch
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-# repository direcotry
-repo_dir=`pwd`
-
-# show usage
-show_usage()
-{
- cat << EOF
-
-usage: create-patch
-
-Creates a patch file between the latest revision of the current tree
-and the latest revision not create by \$BK_USER.
-
-EOF
- exit 0;
-}
-
-if test $1 || test -z $BK_USER
-then
- show_usage
-fi
-
-echo "starting patch..."
-
-echo "user: $BK_USER"
-
-# check for bk and repo_dir
-bk help > /dev/null
-repo_dir=`bk root $repo_dir`
-cd $repo_dir
-
-# determine version
-version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
-echo "version: $version"
-
-# user revision
-user_rev=`bk changes -e -n -d':REV:' | head -1`
-echo "latest revision: $user_rev"
-
-# tree revision
-tree_rev=`bk changes -e -n -d':REV:' -U$BK_USER | head -1`
-echo "latest non-$BK_USER revision: $tree_rev"
-
-# create patch
-patch="$repo_dir/../$BK_USER-$version.patch"
-echo "creating \"$patch\"..."
-bk export -tpatch -r$tree_rev..$user_rev > $patch
-
diff --git a/netware/BUILD/cron-build b/netware/BUILD/cron-build
deleted file mode 100755
index 26ccde28e2a..00000000000
--- a/netware/BUILD/cron-build
+++ /dev/null
@@ -1,46 +0,0 @@
-#! /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
deleted file mode 100755
index 0097f8acaaf..00000000000
--- a/netware/BUILD/crontab
+++ /dev/null
@@ -1,4 +0,0 @@
-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
deleted file mode 100644
index d9a9372b34f..00000000000
--- a/netware/BUILD/knetware.imp
+++ /dev/null
@@ -1,2 +0,0 @@
-kYieldIfTimeSliceUp
-
diff --git a/netware/BUILD/mwasmnlm b/netware/BUILD/mwasmnlm
deleted file mode 100755
index 11fc2bc3842..00000000000
--- a/netware/BUILD/mwasmnlm
+++ /dev/null
@@ -1,11 +0,0 @@
-#! /bin/sh
-
-# stop on errors
-set -e
-
-args=" $*"
-
-# NOTE: Option 'pipefail' is not standard sh
-set -o pipefail
-wine --debugmsg -all -- mwasmnlm $args | \
-perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
diff --git a/netware/BUILD/mwccnlm b/netware/BUILD/mwccnlm
deleted file mode 100755
index 030d87288f2..00000000000
--- a/netware/BUILD/mwccnlm
+++ /dev/null
@@ -1,16 +0,0 @@
-#! /bin/sh
-
-# stop on errors
-set -e
-
-# mwccnlm is having a hard time understanding:
-# * "-I./../include", convert it to "-I../include"
-# * "-I.../..", convert it to "-I../../"
-args=" "`echo $* | sed \
--e 's/-I.\/../-I../g' \
--e 's/\(-I[.\/]*.\) /\1\/ /g'`
-
-# NOTE: Option 'pipefail' is not standard sh
-set -o pipefail
-wine --debugmsg -all -- mwccnlm $args | \
-perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
deleted file mode 100755
index 44497c48917..00000000000
--- a/netware/BUILD/mwenv
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /bin/sh
-
-if test ! -r ./sql/mysqld.cc
-then
- echo "you must start from the top source directory"
- exit 1
-fi
-
-# The base path(in wineformat) where compilers, includes and
-# libraries are installed
-if test -z "$MYDEV"
-then
- # the default is "F:/mydev"
- export MYDEV="F:/mydev"
-fi
-echo "MYDEV: $MYDEV"
-
-# Get current dir
-BUILD_DIR=`pwd`
-echo "BUILD_DIR: $BUILD_DIR"
-
-# Get current dir in wine format
-base=`echo $MYDEV |sed 's/\/.*//'`
-base_unix_part=`winepath -- -u $base/`
-WINE_BUILD_DIR=`echo "$BUILD_DIR" | sed 's_'$base_unix_part'/__'`
-WINE_BUILD_DIR="$base/$WINE_BUILD_DIR"
-echo "WINE_BUILD_DIR: $WINE_BUILD_DIR"
-
-# Look for libc, MySQL 5.1.x uses libc-2006 by default
-libc_dir="$MYDEV/libc-2006"
-if [ ! -d `winepath $libc_dir` ]
-then
- # The libcdir didn't exist, set default
- libc_dir="$MYDEV/libc"
-fi
-echo "Using libc in $libc_dir";
-
-export MWCNWx86Includes="$libc_dir/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.2.3;$WINE_BUILD_DIR/include;$MYDEV"
-export MWNWx86Libraries="$libc_dir/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.2.3;$MYDEV/openssl;$WINE_BUILD_DIR/netware/BUILD"
-export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp"
-
-export WINEPATH="$MYDEV/mw/bin"
-
-# the default added path is "$BUILD_DIR/netware/BUILD"
-export PATH="$PATH:$BUILD_DIR/netware/BUILD"
-
-export AR='mwldnlm'
-export AR_FLAGS='-type library -o'
-export AS='mwasmnlm'
-export CC='mwccnlm -gccincludes'
-export CFLAGS='-enum int -align 8 -proc 686 -relax_pointers -dialect c'
-export CXX='mwccnlm -gccincludes'
-export CXXFLAGS='-enum int -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 -map -flags pseudopreemption'
-export RANLIB=:
-export STRIP=:
-
-#
-# Check that TERM has been set to avoid problem "Error opening
-# terminal: unknown" when the script is executed using non interactive ssh
-#
-if test -z "$TERM" -o "$TERM"=dumb
-then
- export TERM=linux
-fi
-
-# Temporary hack to allow building from source dist
-if [ "$USER"=pushbuild ]
-then
- export ARFLAGS=$AR_FLAGS
-fi
-
-# Print all env. variables
-export
diff --git a/netware/BUILD/mwldnlm b/netware/BUILD/mwldnlm
deleted file mode 100755
index b1822827b59..00000000000
--- a/netware/BUILD/mwldnlm
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh
-
-# stop on errors
-set -e
-
-# If libtool passes "x" as the first argument to this script
-# it's an indication that libtool is trying to unpack .la's
-# so they can be added to a new library
-# This step does not work on Netware and we avoid it by
-# replacing the .la library with the path to the .a library
-# in Makefile.in
-
-args=" $*"
-
-# NOTE: Option 'pipefail' is not standard sh
-set -o pipefail
-wine --debugmsg -all -- mwldnlm $args | \
-perl -pe 's/\r//g; s/^\e.*\e(\[J|>)?//; s/[[^:print:]]//g'
diff --git a/netware/BUILD/nwbuild b/netware/BUILD/nwbuild
deleted file mode 100755
index d431f70add8..00000000000
--- a/netware/BUILD/nwbuild
+++ /dev/null
@@ -1,86 +0,0 @@
-#! /bin/sh
-
-# This script builds a Netware binary from a MySQL source tarball
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-# init
-build=""
-
-# show usage
-show_usage()
-{
- cat << EOF
-
-usage: nwbuild [options]
-
-Build Netware binary from source .tar.gz
-
-options:
-
---build=<opt> Build the binary distributions for NetWare,
- where <opt> is "standard", "debug", or "all"
- (default is to not build a binary distribution)
-
---help Show this help information
-
-Examples:
-
- ./netware/BUILD/nwbuild --build=debug
- ./netware/BUILD/nwbuild --build=standard
-
-EOF
-}
-
-# parse arguments
-for arg do
- case "$arg" in
- --build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
- --help) show_usage; exit 0 ;;
- *) show_usage >&2; exit 1 ;;
- esac
-done
-
-# determine version
-version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
-echo "version: $version"
-
-# make files writeable
-echo "making files writable..."
-chmod -R u+rw,g+rw .
-
-# edit the def file versions
-nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
-echo "updating *.def file versions to $nlm_version..."
-
-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
-
-# create the libmysql.imp file in netware folder from libmysql/libmysql.def
-# file
-echo "generating libmysql.imp file..."
-awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
-# build linux tools
-echo "compiling linux tools..."
-./netware/BUILD/compile-linux-tools
-test -f ./netware/init_db.sql # this must exist
-test -f ./netware/test_db.sql # this must exist
-
-# compile
-if test $build
-then
- echo "compiling $build..."
- ./netware/BUILD/compile-netware-$build
-else
- echo "Preparation complete. Use ./netware/BUILD/compile-netware-* to build MySQL."
-fi
-
-echo "done"
diff --git a/netware/BUILD/openssl.imp b/netware/BUILD/openssl.imp
deleted file mode 100644
index 8972ff5d58c..00000000000
--- a/netware/BUILD/openssl.imp
+++ /dev/null
@@ -1,9 +0,0 @@
-WS2_32_shutdown
-WS2_32_closesocket
-WSASetLastError
-WS2_32_recv
-WSASetLastError
-WS2_32_send
-WSAGetLastError
-GetProcessSwitchCount
-RunningProcess
diff --git a/netware/BUILD/save-patch b/netware/BUILD/save-patch
deleted file mode 100755
index 9f9979ace5b..00000000000
--- a/netware/BUILD/save-patch
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /bin/sh
-
-# debug
-#set -x
-
-# stop on errors
-set -e
-
-# repository directory
-repo_dir=`pwd`
-
-# show usage
-show_usage()
-{
- cat << EOF
-
-usage: save-patch
-
-Creates a patch file between the latest revision of the current tree
-and the latest revision not created by \$BK_USER and places it in
-the tree as netware/current-changes.patch
-
-EOF
- exit 0;
-}
-
-if test $1 || test -z $BK_USER
-then
- show_usage
-fi
-
-echo "starting patch..."
-
-echo "user: $BK_USER"
-
-# check for bk and repo_dir
-bk help > /dev/null
-repo_dir=`bk root $repo_dir`
-cd $repo_dir
-
-# determine version
-version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
-echo "version: $version"
-
-# user revision
-user_rev=`bk changes -e -n -d':REV:' | head -1`
-echo "latest revision: $user_rev"
-
-# tree revision
-tree_rev=`bk changes -e -n -d':REV:' -U$BK_USER | head -1`
-echo "latest non-$BK_USER revision: $tree_rev"
-
-# create patch
-patch="$repo_dir/netware/current-changes.patch"
-echo "creating \"$patch\"..."
-bk export -tpatch -r$tree_rev..$user_rev -xnetware/current-changes.patch > $patch
diff --git a/netware/Makefile.am b/netware/Makefile.am
deleted file mode 100644
index f537022495b..00000000000
--- a/netware/Makefile.am
+++ /dev/null
@@ -1,117 +0,0 @@
-# Copyright (c) 2002 Novell, Inc. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-if HAVE_NETWARE
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
- ../dbug/libdbug.a ../strings/libmystrings.a
-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 \
- @openssl_libs@ @yassl_libs@
-
-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 \
- client/mysqlslap.def client/mysql_upgrade.def \
- sql/mysqld.def extra/mysql_waitpid.def \
- tests/mysql_client_test.def \
- extra/my_print_defaults.def \
- extra/perror.def extra/replace.def \
- extra/resolveip.def extra/comp_err.def \
- extra/resolve_stack_dump.def \
- libmysqld/libmysqld.def \
- storage/myisam/myisamchk.def \
- storage/myisam/myisamlog.def \
- storage/myisam/myisampack.def \
- storage/myisam/myisam_ftdump.def
-
-BUILT_SOURCES = link_sources init_db.sql test_db.sql
-CLEANFILES = $(BUILT_SOURCES)
-
-all: $(BUILT_SOURCES)
-
-link_sources:
- for f in $(netware_build_files); do \
- rm -f ../$$f; \
- org=`basename $$f`; \
- @LN_CP_F@ $(srcdir)/$$org ../$$f; \
- done
- echo timestamp > link_sources
-
-else
-
-BUILT_SOURCES = libmysql.imp init_db.sql test_db.sql
-DISTCLEANFILES = libmysql.imp
-CLEANFILES = init_db.sql test_db.sql
-
-# Create the libmysql.imp from libmysql/libmysql.def
-libmysql.imp: $(top_srcdir)/libmysql/libmysql.def
- $(AWK) 'BEGIN{x=0;} \
- END{printf("\n");} \
- x==1 {printf(" %s",$$1); x++; next} \
- x>1 {printf(",\n %s", $$1); next} \
- /EXPORTS/{x=1}' $(top_srcdir)/libmysql/libmysql.def > libmysql.imp
-
-EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
- libmysql.def \
- libmysqlmain.c my_manage.c my_manage.h \
- my_print_defaults.def myisam_ftdump.def myisamchk.def \
- myisamlog.def myisampack.def mysql.def mysql.xdc \
- mysql_fix_privilege_tables.pl \
- mysql_install_db.c mysql_install_db.def \
- mysql_secure_installation.pl mysql_test_run.c \
- mysql_test_run.def mysql_waitpid.def mysqladmin.def \
- mysqlbinlog.def mysqlcheck.def mysqld.def \
- mysqld_safe.c mysqld_safe.def mysqldump.def mysqlimport.def \
- mysqlshow.def mysqltest.def mysqlslap.def mysql_upgrade.def \
- perror.def \
- mysql_client_test.def \
- replace.def resolve_stack_dump.def resolveip.def \
- static_init_db.sql init_db.sql test_db.sql \
- BUILD/apply-patch BUILD/compile-AUTOTOOLS \
- BUILD/compile-linux-tools BUILD/compile-netware-END \
- BUILD/compile-netware-START BUILD/compile-netware-all\
- BUILD/compile-netware-debug BUILD/compile-netware-max \
- BUILD/compile-netware-max-debug BUILD/compile-netware-src \
- BUILD/compile-netware-standard BUILD/create-patch \
- BUILD/cron-build BUILD/crontab BUILD/knetware.imp \
- BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
- BUILD/nwbuild BUILD/openssl.imp BUILD/save-patch
-
-endif
-
-
-# Build init_db.sql from the files that contain
-# the system tables for this version of MySQL plus any commands
-init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \
- $(top_srcdir)/scripts/mysql_system_tables_data.sql
- @echo "Building $@";
- @echo "CREATE DATABASE mysql;" > $@;
- @echo "CREATE DATABASE test;" >> $@;
- @echo "use mysql;" >> $@;
- @cat $(top_srcdir)/scripts/mysql_system_tables.sql >> $@;
-
-# Build test_db.sql from init_db.sql plus
-# some test data
-test_db.sql: init_db.sql $(top_srcdir)/scripts/mysql_test_data_timezone.sql
- @echo "Building $@";
- @cat init_db.sql \
- $(top_srcdir)/scripts/mysql_test_data_timezone.sql > $@;
diff --git a/netware/comp_err.def b/netware/comp_err.def
deleted file mode 100644
index f5b18bbdb9a..00000000000
--- a/netware/comp_err.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Error File Compiler
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Error File Compiler"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/install_test_db.ncf b/netware/install_test_db.ncf
deleted file mode 100644
index 06befc5d9bd..00000000000
--- a/netware/install_test_db.ncf
+++ /dev/null
@@ -1 +0,0 @@
-# This functionality is handled by mysql-test-run.nlm on NetWare
diff --git a/netware/libmysql.def b/netware/libmysql.def
deleted file mode 100644
index d9d4c752612..00000000000
--- a/netware/libmysql.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Client
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-EXPORT @libmysql.imp
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Client Library"
-VERSION 4, 0
-AUTOUNLOAD
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
diff --git a/netware/libmysqlmain.c b/netware/libmysqlmain.c
deleted file mode 100644
index 2b6ea9b7e27..00000000000
--- a/netware/libmysqlmain.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- Copyright (c) 2002 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include "my_global.h"
-
-void init_available_charsets(void);
-
-/* this function is required so that global memory is allocated against this
-library nlm, and not against a paticular client */
-int _NonAppStart(void *NLMHandle, void *errorScreen, const char *commandLine,
- const char *loadDirPath, size_t uninitializedDataLength,
- void *NLMFileHandle, int (*readRoutineP)( int conn, void *fileHandle,
- size_t offset, size_t nbytes, size_t *bytesRead, void *buffer ),
- size_t customDataOffset, size_t customDataSize, int messageCount,
- const char **messages)
-{
- mysql_server_init(0, NULL, NULL);
-
- init_available_charsets();
-
- return 0;
-}
-
diff --git a/netware/my_manage.c b/netware/my_manage.c
deleted file mode 100644
index 5f59e46374f..00000000000
--- a/netware/my_manage.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- Copyright (c) 2003 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdio.h>
-#include <errno.h>
-#include <dirent.h>
-#include <string.h>
-#include <screen.h>
-#include <proc.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include "my_manage.h"
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- init_args()
-
- Init an argument list.
-
-******************************************************************************/
-void init_args(arg_list_t *al)
-{
- ASSERT(al != NULL);
-
- al->argc = 0;
- al->size = ARG_BUF;
- al->argv = malloc(al->size * sizeof(char *));
- ASSERT(al->argv != NULL);
-
- return;
-}
-
-/******************************************************************************
-
- add_arg()
-
- Add an argument to a list.
-
-******************************************************************************/
-void add_arg(arg_list_t *al, const char *format, ...)
-{
- va_list ap;
- char temp[PATH_MAX];
-
- ASSERT(al != NULL);
-
- // increase size
- if (al->argc >= al->size)
- {
- al->size += ARG_BUF;
- al->argv = realloc(al->argv, al->size * sizeof(char *));
- ASSERT(al->argv != NULL);
- }
-
- if (format)
- {
- va_start(ap, format);
- vsprintf(temp, format, ap);
- va_end(ap);
-
- al->argv[al->argc] = malloc(strlen(temp)+1);
- ASSERT(al->argv[al->argc] != NULL);
- strcpy(al->argv[al->argc], temp);
-
- ++(al->argc);
- }
- else
- {
- al->argv[al->argc] = NULL;
- }
-
- return;
-}
-
-/******************************************************************************
-
- free_args()
-
- Free an argument list.
-
-******************************************************************************/
-void free_args(arg_list_t *al)
-{
- int i;
-
- ASSERT(al != NULL);
-
- for(i = 0; i < al->argc; i++)
- {
- ASSERT(al->argv[i] != NULL);
- free(al->argv[i]);
- al->argv[i] = NULL;
- }
-
- free(al->argv);
- al->argc = 0;
- al->argv = NULL;
-
- return;
-}
-
-/******************************************************************************
-
- sleep_until_file_deleted()
-
- Sleep until the given file is no longer found.
-
-******************************************************************************/
-int sleep_until_file_deleted(char *pid_file)
-{
- struct stat buf;
- int i, err;
-
- for(i = 0; (i < TRY_MAX) && (err = !stat(pid_file, &buf)); i++) sleep(1);
-
- if (err != 0) err = errno;
-
- return err;
-}
-
-/******************************************************************************
-
- sleep_until_file_exists()
-
- Sleep until the given file exists.
-
-******************************************************************************/
-int sleep_until_file_exists(char *pid_file)
-{
- struct stat buf;
- int i, err;
-
- for(i = 0; (i < TRY_MAX) && (err = stat(pid_file, &buf)); i++) sleep(1);
-
- if (err != 0) err = errno;
-
- return err;
-}
-
-/******************************************************************************
-
- wait_for_server_start()
-
- Wait for the server on the given port to start.
-
-******************************************************************************/
-int wait_for_server_start(char *bin_dir, char *user, char *password, int port,char *tmp_dir)
-{
- arg_list_t al;
- int err, i;
- char mysqladmin_file[PATH_MAX];
- char trash[PATH_MAX];
-
- // mysqladmin file
- snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
- snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqladmin_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", port);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "--silent");
-
-#ifdef NOT_USED
- add_arg(&al, "--connect_timeout=10");
- add_arg(&al, "-w");
-#endif
-
- add_arg(&al, "--host=localhost");
- add_arg(&al, "ping");
-
- // NetWare does not support the connect timeout in the TCP/IP stack
- // -- we will try the ping multiple times
- for(i = 0; (i < TRY_MAX)
- && (err = spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL)); i++) sleep(1);
-
- // free args
- free_args(&al);
-
- return err;
-}
-
-/******************************************************************************
-
- spawn()
-
- Spawn the given path with the given arguments.
-
-******************************************************************************/
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error)
-{
- pid_t pid;
- int result = 0;
- wiring_t wiring = { FD_UNUSED, FD_UNUSED, FD_UNUSED };
- unsigned long flags = PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
-
- // open wiring
- if (input)
- wiring.infd = open(input, O_RDONLY);
-
- if (output)
- wiring.outfd = open(output, O_WRONLY | O_CREAT | O_TRUNC);
-
- if (error)
- wiring.errfd = open(error, O_WRONLY | O_CREAT | O_TRUNC);
-
- // procve requires a NULL
- add_arg(al, NULL);
-
- // go
- pid = procve(path, flags, NULL, &wiring, NULL, NULL, 0,
- NULL, (const char **)al->argv);
-
- if (pid == -1)
- {
- result = -1;
- }
- else if (join)
- {
- waitpid(pid, &result, 0);
- }
-
- // close wiring
- if (wiring.infd != -1)
- close(wiring.infd);
-
- if (wiring.outfd != -1)
- close(wiring.outfd);
-
- if (wiring.errfd != -1)
- close(wiring.errfd);
-
- return result;
-}
-
-/******************************************************************************
-
- stop_server()
-
- Stop the server with the given port and pid file.
-
-******************************************************************************/
-int stop_server(char *bin_dir, char *user, char *password, int port,
- char *pid_file,char *tmp_dir)
-{
- arg_list_t al;
- int err, i, argc = 0;
- char mysqladmin_file[PATH_MAX];
- char trash[PATH_MAX];
-
- // mysqladmin file
- snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
- snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqladmin_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", port);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "--shutdown_timeout=20");
- add_arg(&al, "shutdown");
-
- // spawn
- if ((err = spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL)) == 0)
- {
- sleep_until_file_deleted(pid_file);
- }
- else
- {
- pid_t pid = get_server_pid(pid_file);
-
- // shutdown failed - kill server
- kill_server(pid);
-
- sleep(TRY_MAX);
-
- // remove pid file if possible
- err = remove(pid_file);
- }
-
- // free args
- free_args(&al);
-
- return err;
-}
-
-/******************************************************************************
-
- get_server_pid()
-
- Get the VM id with the given pid file.
-
-******************************************************************************/
-pid_t get_server_pid(char *pid_file)
-{
- char buf[PATH_MAX];
- int fd, err;
- char *p;
- pid_t id;
-
- // discover id
- fd = open(pid_file, O_RDONLY);
-
- err = read(fd, buf, PATH_MAX);
-
- close(fd);
-
- if (err > 0)
- {
- // terminate string
- if ((p = strchr(buf, '\n')) != NULL)
- {
- *p = NULL;
-
- // check for a '\r'
- if ((p = strchr(buf, '\r')) != NULL)
- {
- *p = NULL;
- }
- }
- else
- {
- buf[err] = NULL;
- }
-
- id = strtol(buf, NULL, 0);
- }
-
- return id;
-}
-
-/******************************************************************************
-
- kill_server()
-
- Force a kill of the server with the given pid.
-
-******************************************************************************/
-void kill_server(pid_t pid)
-{
- if (pid > 0)
- {
- // destroy vm
- NXVmDestroy(pid);
- }
-}
-
-/******************************************************************************
-
- del_tree()
-
- Delete the directory and subdirectories.
-
-******************************************************************************/
-void del_tree(char *dir)
-{
- DIR *parent = opendir(dir);
- DIR *entry;
- char temp[PATH_MAX];
-
- if (parent == NULL)
- {
- return;
- }
-
- while((entry = readdir(parent)) != NULL)
- {
- // create long name
- snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name);
-
- if (entry->d_name[0] == '.')
- {
- // Skip
- }
- else if (S_ISDIR(entry->d_type))
- {
- // delete subdirectory
- del_tree(temp);
- }
- else
- {
- // remove file
- remove(temp);
- }
- }
-
- // remove directory
- rmdir(dir);
-}
-
-/******************************************************************************
-
- removef()
-
-******************************************************************************/
-int removef(const char *format, ...)
-{
- va_list ap;
- char path[PATH_MAX];
-
- va_start(ap, format);
-
- vsnprintf(path, PATH_MAX, format, ap);
-
- va_end(ap);
-
- return remove(path);
-}
-
-/******************************************************************************
-
- get_basedir()
-
-******************************************************************************/
-void get_basedir(char *argv0, char *basedir)
-{
- char temp[PATH_MAX];
- char *p;
-
- ASSERT(argv0 != NULL);
- ASSERT(basedir != NULL);
-
- strcpy(temp, strlwr(argv0));
- while((p = strchr(temp, '\\')) != NULL) *p = '/';
-
- if ((p = strindex(temp, "/bin/")) != NULL)
- {
- *p = NULL;
- strcpy(basedir, temp);
- }
-}
diff --git a/netware/my_manage.h b/netware/my_manage.h
deleted file mode 100644
index 360f2f104be..00000000000
--- a/netware/my_manage.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (c) 2002 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#ifndef _MY_MANAGE
-#define _MY_MANAGE
-
-/******************************************************************************
-
- includes
-
-******************************************************************************/
-
-#include <stdlib.h>
-#ifndef __WIN__
-#include <unistd.h>
-#endif
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-#ifdef __WIN__
-#define PATH_MAX _MAX_PATH
-#define NAME_MAX _MAX_FNAME
-#define kill(A,B) TerminateProcess((HANDLE)A,0)
-#define NOT_NEED_PID 0
-#define MASTER_PID 1
-#define SLAVE_PID 2
-#define mysqld_timeout 60000
-
-intptr_t master_server;
-intptr_t slave_server;
-int pid_mode;
-bool run_server;
-char win_args[1024];
-bool skip_first_param;
-#endif
-
-
-#define ARG_BUF 10
-#define TRY_MAX 5
-#define NULL (char) 0
-
-#ifdef __NETWARE__
-#define strstr(A,B) strindex(A,B)
-#endif
-
-
-/******************************************************************************
-
- structures
-
-******************************************************************************/
-
-typedef struct
-{
-
- int argc;
- char **argv;
-
- size_t size;
-
-} arg_list_t;
-
-
-typedef int pid_t;
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void init_args(arg_list_t *);
-void add_arg(arg_list_t *, const char *, ...);
-void free_args(arg_list_t *);
-
-int sleep_until_file_exists(char *);
-int sleep_until_file_deleted(char *);
-int wait_for_server_start(char *, char *, char *, int,char *);
-
-int spawn(char *, arg_list_t *, int, char *, char *, char *);
-
-int stop_server(char *, char *, char *, int, char *,char *);
-pid_t get_server_pid(char *);
-void kill_server(pid_t pid);
-
-void del_tree(char *);
-int removef(const char *, ...);
-
-void get_basedir(char *, char *);
-
-char mysqladmin_file[PATH_MAX];
-
-#endif /* _MY_MANAGE */
-
-
diff --git a/netware/my_print_defaults.def b/netware/my_print_defaults.def
deleted file mode 100644
index acba6c81b49..00000000000
--- a/netware/my_print_defaults.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# My Print Defaults
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Print Defaults Tool"
-VERSION 5, 0, 17
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def
deleted file mode 100644
index f2b4890a54d..00000000000
--- a/netware/myisam_ftdump.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL MyISAM Dump Tool
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL MyISAM Table Dump Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL MyISAM Table Dump Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/myisamchk.def b/netware/myisamchk.def
deleted file mode 100644
index 71fb66d0ed1..00000000000
--- a/netware/myisamchk.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MyISAM Check
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL MyISAM Table Check Tool[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL MyISAM Table Check Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/myisamlog.def b/netware/myisamlog.def
deleted file mode 100644
index 1924ba2192b..00000000000
--- a/netware/myisamlog.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MyISAM Log
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL MyISAM Table Log Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL MyISAM Table Log Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/myisampack.def b/netware/myisampack.def
deleted file mode 100644
index 39fd1b34100..00000000000
--- a/netware/myisampack.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MyISAM Pack
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL MyISAM Table Pack Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL MyISAM Table Pack Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysql.def b/netware/mysql.def
deleted file mode 100644
index 4e44f4882d1..00000000000
--- a/netware/mysql.def
+++ /dev/null
@@ -1,13 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Client
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Monitor[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Monitor"
-VERSION 4, 0
-STACKSIZE 131072
-MULTIPLE
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysql.xdc b/netware/mysql.xdc
deleted file mode 100644
index a6c430f7314..00000000000
--- a/netware/mysql.xdc
+++ /dev/null
Binary files differ
diff --git a/netware/mysql_client_test.def b/netware/mysql_client_test.def
deleted file mode 100644
index 9a6f63ec4d7..00000000000
--- a/netware/mysql_client_test.def
+++ /dev/null
@@ -1,10 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Test
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Client Test"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl
deleted file mode 100644
index e40b4158e1c..00000000000
--- a/netware/mysql_fix_privilege_tables.pl
+++ /dev/null
@@ -1,227 +0,0 @@
-#-----------------------------------------------------------------------------
-# Copyright (C) 2002 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# This notice applies to changes, created by or for Novell, Inc.,
-# to preexisting works for which notices appear elsewhere in this file.
-
-# Copyright (c) 2003 Novell, Inc. All Rights Reserved.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#-----------------------------------------------------------------------------
-
-#use strict;
-use Mysql;
-
-print "MySQL Fix Privilege Tables Script\n\n";
-
-print "NOTE: This script updates your privilege tables to the lastest\n";
-print " specifications!\n\n";
-
-#-----------------------------------------------------------------------------
-# get the current root password
-#-----------------------------------------------------------------------------
-
-print "In order to log into MySQL to update it, we'll need the current\n";
-print "password for the root user. If you've just installed MySQL, and\n";
-print "you haven't set the root password yet, the password will be blank,\n";
-print "so you should just press enter here.\n\n";
-
-print "Enter the current password for root: ";
-my $password = <STDIN>;
-chomp $password;
-print "\n";
-
-my $conn = Mysql->connect("localhost", "mysql", "root", $password)
- || die "Unable to connect to MySQL.";
-
-print "OK, successfully used the password, moving on...\n\n";
-
-
-#-----------------------------------------------------------------------------
-# MySQL 4.0.2
-#-----------------------------------------------------------------------------
-
-#-- Detect whether or not we had the Grant_priv column
-print "Fixing privileges for old tables...\n";
-$conn->query("SET \@hadGrantPriv:=0;");
-$conn->query("SELECT \@hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';");
-
-#--- Fix privileges for old tables
-$conn->query("UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
-$conn->query("UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
-$conn->query("UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
-
-
-# Detect whether we had Show_db_priv
-$conn->query("SET \@hadShowDbPriv:=0;");
-$conn->query("SELECT \@hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%';");
-
-print "Adding new fields used by MySQL 4.0.2 to the privilege tables...\n";
-print "NOTE: You can ignore any Duplicate column errors.\n";
-$conn->query(" \
-ALTER TABLE user \
-ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv, \
-ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, \
-ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, \
-ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, \
-ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, \
-ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, \
-ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; \
-") && $conn->query(" \
-UPDATE user SET show_db_priv=select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>''AND \@hadShowDbPriv = 0; \
-");
-
-#-- The above statement converts privileges so that users have similar privileges as before
-
-#-----------------------------------------------------------------------------
-# MySQL 4.0 Limitations
-#-----------------------------------------------------------------------------
-
-print "Adding new fields used by MySQL 4.0 security limitations...\n";
-
-$conn->query(" \
-ALTER TABLE user \
-ADD max_questions int(11) NOT NULL AFTER x509_subject, \
-ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, \
-ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; \
-");
-
-#-- Change the password column to suite the new password hashing used
-#-- in 4.1.1 onward
-$conn->query("ALTER TABLE user change Password Password char(41) binary not null;");
-
-#-- The second alter changes ssl_type to new 4.0.2 format
-#-- Adding columns needed by GRANT .. REQUIRE (openssl)"
-print "Adding new fields to use in ssl authentication...\n";
-
-$conn->query(" \
-ALTER TABLE user \
-ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, \
-ADD ssl_cipher BLOB NOT NULL, \
-ADD x509_issuer BLOB NOT NULL, \
-ADD x509_subject BLOB NOT NULL; \
-");
-
-#-----------------------------------------------------------------------------
-# MySQL 4.0 DB and Host privs
-#-----------------------------------------------------------------------------
-
-print "Adding new fields used by MySQL 4.0 locking and temporary table security...\n";
-
-$conn->query(" \
-ALTER TABLE db \
-ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, \
-ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \
-");
-
-$conn->query(" \
-ALTER TABLE host \
-ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, \
-ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \
-");
-
-#
-# Change the Table_name column to be of char(64) which was char(60) by mistake till now.
-#
-$conn->query("alter table tables_priv change Table_name Table_name char(64) binary DEFAULT '' NOT NULL;");
-
-
-#
-# Create some possible missing tables
-#
-print "Adding online help tables...\n";
-
-$conn->query(" \
-CREATE TABLE IF NOT EXISTS help_topic ( \
-help_topic_id int unsigned not null, \
-name varchar(64) not null, \
-help_category_id smallint unsigned not null, \
-description text not null, \
-example text not null, \
-url varchar(128) not null, \
-primary key (help_topic_id), unique index (name) \
-) comment='help topics'; \
-");
-
-$conn->query(" \
-CREATE TABLE IF NOT EXISTS help_category ( \
-help_category_id smallint unsigned not null, \
-name varchar(64) not null, \
-parent_category_id smallint unsigned null, \
-url varchar(128) not null, \
-primary key (help_category_id), \
-unique index (name) \
-) comment='help categories'; \
-");
-
-$conn->query(" \
-CREATE TABLE IF NOT EXISTS help_relation ( \
-help_topic_id int unsigned not null references help_topic, \
-help_keyword_id int unsigned not null references help_keyword, \
-primary key (help_keyword_id, help_topic_id) \
-) comment='keyword-topic relation'; \
-");
-
-$conn->query(" \
-CREATE TABLE IF NOT EXISTS help_keyword ( \
-help_keyword_id int unsigned not null, \
-name varchar(64) not null, \
-primary key (help_keyword_id), \
-unique index (name) \
-) comment='help keywords'; \
-");
-
-
-#
-# Filling the help tables with contents.
-#
-print "Filling online help tables with contents...\n";
-# Generate the path for "fill_help_tables.sql" file which is in different folder.
-$fill_help_table=$0;
-$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/share\\fill_help_tables.sql/;
-
-#read all content from the sql file which contains recordsfor help tables.
-open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!");
-@logData = <fileIN>;
-close(fileIN);
-foreach $line (@logData) {
-# if the line is not empty, insert a record in the table.
- if( ! ($line =~ /^\s*$/) ) {
- $conn->query("$line");
- }
-}
-
-#-----------------------------------------------------------------------------
-# done
-#-----------------------------------------------------------------------------
-
-print "\n\nAll done!\n\n";
-
-print "Thanks for using MySQL!\n\n";
diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c
deleted file mode 100644
index 98852c89825..00000000000
--- a/netware/mysql_install_db.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- Copyright (c) 2002 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <netdb.h>
-#include <sys/stat.h>
-#include <monitor.h>
-#include <strings.h>
-#include <getopt.h>
-#include <screen.h>
-#include <errno.h>
-
-#include "my_config.h"
-#include "my_manage.h"
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-char autoclose;
-char basedir[PATH_MAX];
-char datadir[PATH_MAX];
-char err_log[PATH_MAX];
-char out_log[PATH_MAX];
-char mysqld[PATH_MAX];
-char hostname[PATH_MAX];
-char sql_file[PATH_MAX];
-char default_option[PATH_MAX];
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void start_defaults(int, char*[]);
-void finish_defaults();
-void read_defaults(arg_list_t *);
-void parse_args(int, char*[]);
-void get_options(int, char*[]);
-void create_paths();
-int mysql_install_db(int argc, char *argv[]);
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- start_defaults()
-
- Start setting the defaults.
-
-******************************************************************************/
-void start_defaults(int argc, char *argv[])
-{
- struct stat buf;
- int i;
-
- // default options
- static char *default_options[] =
- {
- "--no-defaults",
- "--defaults-file=",
- "--defaults-extra-file=",
- NULL
- };
-
- // autoclose
- autoclose = FALSE;
-
- // basedir
- get_basedir(argv[0], basedir);
-
- // hostname
- if (gethostname(hostname,PATH_MAX) < 0)
- {
- // default
- strcpy(hostname,"mysql");
- }
-
- // default option
- default_option[0] = NULL;
- for (i=0; (argc > 1) && default_options[i]; i++)
- {
- if(!strnicmp(argv[1], default_options[i], strlen(default_options[i])))
- {
- strncpy(default_option, argv[1], PATH_MAX);
- break;
- }
- }
-
- // set after basedir is established
- datadir[0] = NULL;
- err_log[0] = NULL;
- out_log[0] = NULL;
- mysqld[0] = NULL;
- sql_file[0] = NULL;
-}
-
-/******************************************************************************
-
- finish_defaults()
-
- Finish setting the defaults.
-
-******************************************************************************/
-void finish_defaults()
-{
- struct stat buf;
- int i;
-
- // datadir
- if (!datadir[0]) snprintf(datadir, PATH_MAX, "%s/data", basedir);
-
- // err-log
- if (!err_log[0]) snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname);
-
- // out-log
- if (!out_log[0]) snprintf(out_log, PATH_MAX, "%s/%s.out", datadir, hostname);
-
- // sql-file
- if (!sql_file[0]) snprintf(sql_file, PATH_MAX, "%s/bin/init_db.sql", basedir);
-
- // mysqld
- if (!mysqld[0]) snprintf(mysqld, PATH_MAX, "%s/bin/mysqld", basedir);
-}
-
-/******************************************************************************
-
- read_defaults()
-
- Read the defaults.
-
-******************************************************************************/
-void read_defaults(arg_list_t *pal)
-{
- arg_list_t al;
- char defaults_file[PATH_MAX];
- char mydefaults[PATH_MAX];
- char line[PATH_MAX];
- FILE *fp;
-
- // defaults output file
- snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
- remove(defaults_file);
-
- // mysqladmin file
- snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
-
- // args
- init_args(&al);
- add_arg(&al, mydefaults);
- if (default_option[0]) add_arg(&al, default_option);
- add_arg(&al, "mysqld");
- add_arg(&al, "mysql_install_db");
-
- spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL);
-
- free_args(&al);
-
- // gather defaults
- if((fp = fopen(defaults_file, "r")) != NULL)
- {
- while(fgets(line, PATH_MAX, fp))
- {
- char *p;
-
- // remove end-of-line character
- if ((p = strrchr(line, '\n')) != NULL) *p = '\0';
-
- // add the option as an argument
- add_arg(pal, line);
- }
-
- fclose(fp);
- }
-
- // remove file
- remove(defaults_file);
-}
-
-/******************************************************************************
-
- parse_args()
-
- Get the options.
-
-******************************************************************************/
-void parse_args(int argc, char *argv[])
-{
- int index = 0;
- int c;
-
- // parse options
- enum opts
- {
- OPT_BASEDIR = 0xFF,
- OPT_DATADIR,
- OPT_SQL_FILE
- };
-
- static struct option options[] =
- {
- {"autoclose", no_argument, &autoclose, TRUE},
- {"basedir", required_argument, 0, OPT_BASEDIR},
- {"datadir", required_argument, 0, OPT_DATADIR},
- {"sql-file", required_argument, 0, OPT_SQL_FILE},
- {0, 0, 0, 0}
- };
-
- // we have to reset getopt_long because we use it multiple times
- optind = 1;
-
- // turn off error reporting
- opterr = 0;
-
- while ((c = getopt_long(argc, argv, "b:h:", options, &index)) >= 0)
- {
- switch (c)
- {
- case OPT_BASEDIR:
- case 'b':
- strcpy(basedir, optarg);
- break;
-
- case OPT_DATADIR:
- case 'h':
- strcpy(datadir, optarg);
- break;
-
- case OPT_SQL_FILE:
- strcpy(sql_file, optarg);
- break;
-
- default:
- // ignore
- break;
- }
- }
-}
-
-/******************************************************************************
-
- get_options()
-
- Get the options.
-
-******************************************************************************/
-void get_options(int argc, char *argv[])
-{
- arg_list_t al;
-
- // start defaults
- start_defaults(argc, argv);
-
- // default file arguments
- init_args(&al);
- add_arg(&al, "ignore");
- read_defaults(&al);
- parse_args(al.argc, al.argv);
- free_args(&al);
-
- // command-line arguments
- parse_args(argc, argv);
-
- // finish defaults
- finish_defaults();
-}
-
-/******************************************************************************
-
- create_paths()
-
- Create database paths.
-
-******************************************************************************/
-void create_paths()
-{
- struct stat info;
- char temp[PATH_MAX];
-
- // check for tables
- snprintf(temp, PATH_MAX, "%s/mysql/host.frm", datadir);
- if (!stat(temp, &info))
- {
- printf("A database already exists in the directory:\n");
- printf("\t%s\n\n", datadir);
- exit(-1);
- }
-
- // data directory
- if (stat(datadir, &info))
- {
- mkdir(datadir, 0);
- }
-}
-
-/******************************************************************************
-
- mysql_install_db()
-
- Install the database.
-
-******************************************************************************/
-int mysql_install_db(int argc, char *argv[])
-{
- arg_list_t al;
- int i, j, err;
- char skip;
- struct stat info;
-
- // private options
- static char *private_options[] =
- {
- "--autoclose",
- "--sql-file=",
- NULL
- };
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqld);
-
- // parent args
- for(i = 1; i < argc; i++)
- {
- skip = FALSE;
-
- // skip private arguments
- for (j=0; private_options[j]; j++)
- {
- if(!strnicmp(argv[i], private_options[j], strlen(private_options[j])))
- {
- skip = TRUE;
- break;
- }
- }
-
- if (!skip) add_arg(&al, "%s", argv[i]);
- }
-
- add_arg(&al, "--bootstrap");
- add_arg(&al, "--skip-grant-tables");
- add_arg(&al, "--skip-innodb");
-
- if ((err = stat(sql_file, &info)) != 0)
- {
- printf("ERROR - %s:\n", strerror(errno));
- printf("\t%s\n\n", sql_file);
- // free args
- free_args(&al);
- exit(-1);
- }
-
- if ((err = stat(sql_file, &info)) != 0)
- {
- printf("ERROR - %s:\n", strerror(errno));
- printf("\t%s\n\n", sql_file);
- // free args
- free_args(&al);
- exit(-1);
- }
-
- // spawn mysqld
- err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log);
-
- // free args
- free_args(&al);
-
- return err;
-}
-
-/******************************************************************************
-
- main()
-
-******************************************************************************/
-int main(int argc, char **argv)
-{
- // get options
- get_options(argc, argv);
-
- // check for an autoclose option
- if (!autoclose) setscreenmode(SCR_NO_MODE);
-
- // header
- printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE,
- MACHINE_TYPE);
-
- // create paths
- create_paths();
-
- // install the database
- if (mysql_install_db(argc, argv))
- {
- printf("ERROR - Failed to create the database!\n");
- printf(" %s\n", strerror(errno));
- printf("See the following log for more information:\n");
- printf("\t%s\n\n", err_log);
- exit(-1);
- }
-
- // status
- printf("Initial database successfully created in the directory:\n");
- printf("\t%s\n", datadir);
-
- // info
- printf("\nPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !\n");
-
- printf("\nThis is done with:\n");
- printf("\tmysqladmin -u root password 'new-password'\n");
-
- printf("\nSee the manual for more instructions.\n");
-
- printf("\nYou can start the MySQL daemon with:\n");
- printf("\tmysqld_safe\n");
-
- printf("\nPlease report any problems with:\n");
- printf("\t/mysql/mysqlbug.txt\n");
-
- printf("\nThe latest information about MySQL is available on the web at\n");
- printf("\thttp://www.mysql.com\n");
-
- printf("\nSupport MySQL by buying support at http://shop.mysql.com\n\n");
-
- return 0;
-}
diff --git a/netware/mysql_install_db.def b/netware/mysql_install_db.def
deleted file mode 100644
index e3dc57fe44c..00000000000
--- a/netware/mysql_install_db.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Install DB
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Install"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Initial Database Installer"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysql_secure_installation.pl b/netware/mysql_secure_installation.pl
deleted file mode 100644
index 8550f0e6d6e..00000000000
--- a/netware/mysql_secure_installation.pl
+++ /dev/null
@@ -1,218 +0,0 @@
-#-----------------------------------------------------------------------------
-# Copyright (C) 2002 MySQL AB and Jeremy Cole
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# This notice applies to changes, created by or for Novell, Inc.,
-# to preexisting works for which notices appear elsewhere in this file.
-
-# Copyright (c) 2003 Novell, Inc. All Rights Reserved.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#-----------------------------------------------------------------------------
-
-use strict;
-use Mysql;
-
-print "MySQL Secure Installation Script\n\n";
-
-print "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL\n";
-print " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!\n\n";
-
-#-----------------------------------------------------------------------------
-# get the current root password
-#-----------------------------------------------------------------------------
-
-print "In order to log into MySQL to secure it, we'll need the current\n";
-print "password for the root user. If you've just installed MySQL, and\n";
-print "you haven't set the root password yet, the password will be blank,\n";
-print "so you should just press enter here.\n\n";
-
-print "Enter the current password for root: ";
-my $password = <STDIN>;
-chomp $password;
-print "\n";
-
-my $conn = Mysql->connect("localhost", "mysql", "root", $password)
- || die "Unable to connect to MySQL.";
-
-print "OK, successfully used the password, moving on...\n\n";
-
-#-----------------------------------------------------------------------------
-# set the root password
-#-----------------------------------------------------------------------------
-
-unless ($password)
-{
- print "Setting the root password ensures that no one can log into MySQL\n";
- print "using the root user without the proper authorization.\n\n";
-
- print "Set root password (Y/N)? ";
- my $reply = <STDIN>;
- chomp $reply;
- print "\n";
-
- if ($reply =~ /Y/i)
- {
- print "New password for root: ";
- my $pass1 = <STDIN>;
- chomp $pass1;
- print "\n";
-
- print "Re-enter new password for root: ";
- my $pass2 = <STDIN>;
- chomp $pass2;
- print "\n";
-
- unless ($pass1 eq $pass2) { die "Sorry, the passwords do not match."; }
-
- unless ($pass1) { die "Sorry, you can't use an empty password here."; }
-
- $conn->query("SET PASSWORD FOR root\@localhost=PASSWORD('$pass1')")
- || die "Unable to set password.";
-
- print "OK, successfully set the password, moving on...\n\n";
- }
- else
- {
- print "WARNING, the password is not set, moving on...\n\n";
- }
-}
-
-#-----------------------------------------------------------------------------
-# remove anonymous users
-#-----------------------------------------------------------------------------
-
-print "By default, a MySQL installation has anonymous users, allowing anyone\n";
-print "to log into MySQL without having to have a user account created for\n";
-print "them. This is intended only for testing, and to make the installation\n";
-print "go a bit smoother. You should remove them before moving into a\n";
-print "production environment.\n\n";
-
-print "Remove anonymous users (Y/N)? ";
-my $reply = <STDIN>;
-chomp $reply;
-print "\n";
-
-if ($reply =~ /Y/i)
-{
- $conn->query("DELETE FROM mysql.user WHERE user=''")
- || die "Unable to remove anonymous users.";
-
- print "OK, successfully removed anonymous users, moving on...\n\n";
-}
-else
-{
- print "WARNING, the anonymous users have not been removed, moving on...\n\n";
-}
-
-#-----------------------------------------------------------------------------
-# disallow remote root login
-#-----------------------------------------------------------------------------
-
-print "Normally, root should only be allowed to connect from 'localhost'. This\n";
-print "ensures that someone cannot guess at the root password from the network.\n\n";
-
-print "Disallow remote root login (Y/N)? ";
-my $reply = <STDIN>;
-chomp $reply;
-print "\n";
-
-if ($reply =~ /Y/i)
-{
- $conn->query("DELETE FROM mysql.user WHERE user='root' AND host!='localhost'")
- || die "Unable to disallow remote root login.";
-
- print "OK, successfully disallowed remote root login, moving on...\n\n";
-}
-else
-{
- print "WARNING, remote root login has not been disallowed, moving on...\n\n";
-}
-
-#-----------------------------------------------------------------------------
-# remove test database
-#-----------------------------------------------------------------------------
-
-print "By default, MySQL comes with a database named 'test' that anyone can\n";
-print "access. This is intended only for testing, and should be removed\n";
-print "before moving into a production environment.\n\n";
-
-print "Remove the test database (Y/N)? ";
-my $reply = <STDIN>;
-chomp $reply;
-print "\n";
-
-if ($reply =~ /Y/i)
-{
- $conn->query("DROP DATABASE IF EXISTS test")
- || die "Unable to remove test database.";
-
- $conn->query("DELETE FROM mysql.db WHERE db='test' OR db='test\\_%'")
- || die "Unable to remove access to the test database.";
-
- print "OK, successfully removed the test database, moving on...\n\n";
-}
-else
-{
- print "WARNING, the test database has not been removed, moving on...\n\n";
-}
-
-#-----------------------------------------------------------------------------
-# reload privilege tables
-#-----------------------------------------------------------------------------
-
-print "Reloading the privilege tables will ensure that all changes made so far\n";
-print "will take effect immediately.\n\n";
-
-print "Reload privilege tables (Y/N)? ";
-my $reply = <STDIN>;
-chomp $reply;
-print "\n";
-
-if ($reply =~ /Y/i)
-{
- $conn->query("FLUSH PRIVILEGES")
- || die "Unable to reload privilege tables.";
-
- print "OK, successfully reloaded privilege tables, moving on...\n\n";
-}
-else
-{
- print "WARNING, the privilege tables have not been reloaded, moving on...\n\n";
-}
-
-#-----------------------------------------------------------------------------
-# done
-#-----------------------------------------------------------------------------
-
-print "\n\nAll done! If you've completed all of the above steps, your MySQL\n";
-print "installation should now be secure.\n\n";
-
-print "Thanks for using MySQL!\n\n";
-
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
deleted file mode 100644
index 5fa92b325b6..00000000000
--- a/netware/mysql_test_run.c
+++ /dev/null
@@ -1,1415 +0,0 @@
-/*
- Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <my_global.h>
-#include <m_string.h>
-#include <dirent.h>
-#include <screen.h>
-#include <nks/vm.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <sys/mode.h>
-#include "my_manage.h"
-#include "mysql_version.h"
-#ifdef __NETWARE__
-#define strindex(a,b) ((char*)strindex(a,b))
-#define strstr(a,b) ((char*)strstr(a,b))
-#endif
-
-/******************************************************************************
-
- macros
-
-******************************************************************************/
-
-#define HEADER "TEST ELAPSED RESULT \n"
-#define DASH "------------------------------------------------------------------------\n"
-
-#define NW_TEST_SUFFIX ".nw-test"
-#define NW_RESULT_SUFFIX ".nw-result"
-#define TEST_SUFFIX ".test"
-#define RESULT_SUFFIX ".result"
-#define REJECT_SUFFIX ".reject"
-#define OUT_SUFFIX ".out"
-#define ERR_SUFFIX ".err"
-
-#define TEST_PASS "[ pass ]"
-#define TEST_SKIP "[ skip ]"
-#define TEST_FAIL "[ fail ]"
-#define TEST_BAD "[ bad ]"
-#define TEST_IGNORE "[ignore]"
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-
-char base_dir[PATH_MAX] = "sys:/mysql";
-char db[PATH_MAX] = "test";
-char user[PATH_MAX] = "root";
-char password[PATH_MAX] = "";
-
-int master_port = 9306;
-int slave_port = 9307;
-
-// comma delimited list of tests to skip or empty string
-char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix ";
-char ignore_test[PATH_MAX] = "";
-
-char bin_dir[PATH_MAX];
-char mysql_test_dir[PATH_MAX];
-char test_dir[PATH_MAX];
-char mysql_tmp_dir[PATH_MAX];
-char result_dir[PATH_MAX];
-char master_dir[PATH_MAX];
-char slave_dir[PATH_MAX];
-char lang_dir[PATH_MAX];
-char char_dir[PATH_MAX];
-
-char mysqladmin_file[PATH_MAX];
-char mysqld_file[PATH_MAX];
-char mysqltest_file[PATH_MAX];
-char master_pid[PATH_MAX];
-char slave_pid[PATH_MAX];
-
-char master_opt[PATH_MAX] = "";
-char slave_opt[PATH_MAX] = "";
-
-char slave_master_info[PATH_MAX] = "";
-
-char master_init_script[PATH_MAX] = "";
-char slave_init_script[PATH_MAX] = "";
-
-// OpenSSL
-char ca_cert[PATH_MAX];
-char server_cert[PATH_MAX];
-char server_key[PATH_MAX];
-char client_cert[PATH_MAX];
-char client_key[PATH_MAX];
-
-int total_skip = 0;
-int total_pass = 0;
-int total_fail = 0;
-int total_test = 0;
-
-int total_ignore = 0;
-double total_time = 0;
-
-int use_openssl = FALSE;
-int master_running = FALSE;
-int slave_running = FALSE;
-int skip_slave = TRUE;
-int single_test = TRUE;
-
-int restarts = 0;
-
-FILE *log_fd = NULL;
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void report_stats();
-void install_db(char *);
-void mysql_install_db();
-void start_master();
-void start_slave();
-void mysql_start();
-void stop_slave();
-void stop_master();
-void mysql_stop();
-void mysql_restart();
-int read_option(char *, char *);
-void run_test(char *);
-void setup(char *);
-void vlog(char *, va_list);
-void log_msg(char *, ...);
-void log_info(char *, ...);
-void log_error(char *, ...);
-void log_errno(char *, ...);
-void die(char *);
-char *str_tok(char *string, const char *delim);
-
-/******************************************************************************
-
- report_stats()
-
- Report the gathered statistics.
-
-******************************************************************************/
-void report_stats()
-{
- if (total_fail == 0)
- {
- log_msg("\nAll %d test(s) were successful.\n", total_test);
- }
- else
- {
- double percent = ((double)total_pass / total_test) * 100;
-
- log_msg("\nFailed %u/%u test(s), %.02f%% successful.\n",
- total_fail, total_test, percent);
- log_msg("\nThe .out and .err files in %s may give you some\n", result_dir);
- log_msg("hint of what went wrong.\n");
- log_msg("\nIf you want to report this error, please first read the documentation\n");
- log_msg("at: http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html\n");
- }
-
- log_msg("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60);
-}
-
-/******************************************************************************
-
- install_db()
-
- Install the a database.
-
-******************************************************************************/
-void install_db(char *datadir)
-{
- arg_list_t al;
- int err, i;
- char input[PATH_MAX];
- char output[PATH_MAX];
- char error[PATH_MAX];
-
- // input file
- snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir);
- snprintf(output, PATH_MAX, "%s/install.out", datadir);
- snprintf(error, PATH_MAX, "%s/install.err", datadir);
-
- // args
- init_args(&al);
- add_arg(&al, mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--bootstrap");
- add_arg(&al, "--skip-grant-tables");
- add_arg(&al, "--basedir=%s", base_dir);
- add_arg(&al, "--datadir=%s", datadir);
- add_arg(&al, "--skip-innodb");
-
- // spawn
- if ((err = spawn(mysqld_file, &al, TRUE, input, output, error)) != 0)
- {
- die("Unable to create database.");
- }
-
- // free args
- free_args(&al);
-}
-
-/******************************************************************************
-
- mysql_install_db()
-
- Install the test databases.
-
-******************************************************************************/
-void mysql_install_db()
-{
- char temp[PATH_MAX];
-
- // var directory
- snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir);
-
- // clean up old direcotry
- del_tree(temp);
-
- // create var directory
- mkdir(temp, S_IRWXU);
-
- // create subdirectories
- log_msg("Creating test-suite folders...\n");
- snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir);
- mkdir(temp, S_IRWXU);
- snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir);
- mkdir(temp, S_IRWXU);
-
- // install databases
- log_msg("Creating test databases for master... \n");
- install_db(master_dir);
- log_msg("Creating test databases for slave... \n");
- install_db(slave_dir);
-}
-
-/******************************************************************************
-
- start_master()
-
- Start the master server.
-
-******************************************************************************/
-void start_master()
-{
- arg_list_t al;
- int err, i;
- char master_out[PATH_MAX];
- char master_err[PATH_MAX];
- char temp[PATH_MAX], temp2[PATH_MAX];
-
- // remove old berkeley db log files that can confuse the server
- removef("%s/log.*", master_dir);
-
- // remove stale binary logs
- removef("%s/var/log/*-bin.*", mysql_test_dir);
-
- // remove stale binary logs
- removef("%s/var/log/*.index", mysql_test_dir);
-
- // remove master.info file
- removef("%s/master.info", master_dir);
-
- // remove relay files
- removef("%s/var/log/*relay*", mysql_test_dir);
-
- // remove relay-log.info file
- removef("%s/relay-log.info", master_dir);
-
- // init script
- 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
- snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out",
- mysql_test_dir, restarts);
- snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err",
- mysql_test_dir, restarts);
-
- snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir);
- mkdir(temp2,0);
- snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir);
- mkdir(temp2,0);
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir);
- add_arg(&al, "--server-id=1");
- add_arg(&al, "--basedir=%s", base_dir);
- add_arg(&al, "--port=%u", master_port);
- add_arg(&al, "--local-infile");
- add_arg(&al, "--core");
- add_arg(&al, "--datadir=%s", master_dir);
- add_arg(&al, "--pid-file=%s", master_pid);
- add_arg(&al, "--character-sets-dir=%s", char_dir);
- add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
- add_arg(&al, "--language=%s", lang_dir);
- add_arg(&al, "--log-bin-trust-function-creators");
- add_arg(&al, "--log-slow-queries");
- add_arg(&al, "--log-queries-not-using-indexes");
-#ifdef DEBUG //only for debug builds
- add_arg(&al, "--debug");
-#endif
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", server_cert);
- add_arg(&al, "--ssl-key=%s", server_key);
- }
-
- // $MASTER_40_ARGS
- add_arg(&al, "--rpl-recovery-rank=1");
- add_arg(&al, "--init-rpl-role=master");
-
- // $SMALL_SERVER
- add_arg(&al, "--key_buffer_size=1M");
- add_arg(&al, "--sort_buffer=256K");
- add_arg(&al, "--max_heap_table_size=1M");
-
- // $EXTRA_MASTER_OPT
- if (master_opt[0] != NULL)
- {
- char *p;
-
- p = (char *)str_tok(master_opt, " \t");
- if (!strstr(master_opt, "timezone"))
- {
- while (p)
- {
- add_arg(&al, "%s", p);
- p = (char *)str_tok(NULL, " \t");
- }
- }
- }
-
- // remove the pid file if it exists
- remove(master_pid);
-
- // spawn
- if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err)) == 0)
- {
- sleep_until_file_exists(master_pid);
-
- if ((err = wait_for_server_start(bin_dir, user, password, master_port,
- mysql_tmp_dir)) == 0)
- {
- master_running = TRUE;
- }
- else
- {
- log_error("The master server went down early.");
- }
- }
- else
- {
- log_error("Unable to start master server.");
- }
-
- // free_args
- free_args(&al);
-}
-
-/******************************************************************************
-
- start_slave()
-
- Start the slave server.
-
-******************************************************************************/
-void start_slave()
-{
- arg_list_t al;
- int err, i;
- char slave_out[PATH_MAX];
- char slave_err[PATH_MAX];
- char temp[PATH_MAX];
-
- // skip?
- if (skip_slave) return;
-
- // remove stale binary logs
- removef("%s/*-bin.*", slave_dir);
-
- // remove stale binary logs
- removef("%s/*.index", slave_dir);
-
- // remove master.info file
- removef("%s/master.info", slave_dir);
-
- // remove relay files
- removef("%s/var/log/*relay*", mysql_test_dir);
-
- // remove relay-log.info file
- removef("%s/relay-log.info", slave_dir);
-
- // init script
- if (slave_init_script[0] != NULL)
- {
- // run_init_script(slave_init_script);
-
- // TODO: use the scripts
- if (strindex(slave_init_script, "rpl000016-slave.sh") != NULL)
- {
- // create empty master.info file
- snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
- }
- else if (strindex(slave_init_script, "rpl000017-slave.sh") != NULL)
- {
- FILE *fp;
-
- // create a master.info file
- snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- fp = fopen(temp, "wb+");
-
- fputs("master-bin.000001\n", fp);
- fputs("4\n", fp);
- fputs("127.0.0.1\n", fp);
- fputs("replicate\n", fp);
- fputs("aaaaaaaaaaaaaaab\n", fp);
- fputs("9306\n", fp);
- fputs("1\n", fp);
- fputs("0\n", fp);
-
- fclose(fp);
- }
- else if (strindex(slave_init_script, "rpl_rotate_logs-slave.sh") != NULL)
- {
- // create empty master.info file
- snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
- }
- }
-
- // redirection files
- snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out",
- mysql_test_dir, restarts);
- snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err",
- mysql_test_dir, restarts);
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqld_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--log-bin=slave-bin");
- add_arg(&al, "--relay_log=slave-relay-bin");
- add_arg(&al, "--basedir=%s", base_dir);
- add_arg(&al, "--port=%u", slave_port);
- add_arg(&al, "--datadir=%s", slave_dir);
- add_arg(&al, "--pid-file=%s", slave_pid);
- add_arg(&al, "--character-sets-dir=%s", char_dir);
- add_arg(&al, "--core");
- add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
- add_arg(&al, "--language=%s", lang_dir);
-
- add_arg(&al, "--exit-info=256");
- add_arg(&al, "--log-slave-updates");
- add_arg(&al, "--init-rpl-role=slave");
- add_arg(&al, "--skip-innodb");
- add_arg(&al, "--skip-slave-start");
- add_arg(&al, "--slave-load-tmpdir=../../var/tmp");
-
- add_arg(&al, "--report-user=%s", user);
- add_arg(&al, "--report-host=127.0.0.1");
- add_arg(&al, "--report-port=%u", slave_port);
-
- add_arg(&al, "--master-retry-count=10");
- add_arg(&al, "--slave_net_timeout=10");
- add_arg(&al, "--log-bin-trust-function-creators");
- add_arg(&al, "--log-slow-queries");
- add_arg(&al, "--log-queries-not-using-indexes");
-#ifdef DEBUG //only for debug builds
- add_arg(&al, "--debug");
-#endif
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", server_cert);
- add_arg(&al, "--ssl-key=%s", server_key);
- }
-
- // slave master info
- if (slave_master_info[0] != NULL)
- {
- char *p;
-
- p = (char *)str_tok(slave_master_info, " \t");
-
- while(p)
- {
- add_arg(&al, "%s", p);
-
- p = (char *)str_tok(NULL, " \t");
- }
- }
- else
- {
- add_arg(&al, "--master-user=%s", user);
- add_arg(&al, "--master-password=%s", password);
- add_arg(&al, "--master-host=127.0.0.1");
- add_arg(&al, "--master-port=%u", master_port);
- add_arg(&al, "--master-connect-retry=1");
- add_arg(&al, "--server-id=2");
- add_arg(&al, "--rpl-recovery-rank=2");
- }
-
- // small server
- add_arg(&al, "--key_buffer_size=1M");
- add_arg(&al, "--sort_buffer=256K");
- add_arg(&al, "--max_heap_table_size=1M");
-
- // opt args
- if (slave_opt[0] != NULL)
- {
- char *p;
-
- p = (char *)str_tok(slave_opt, " \t");
-
- while(p)
- {
- add_arg(&al, "%s", p);
-
- p = (char *)str_tok(NULL, " \t");
- }
- }
-
- // remove the pid file if it exists
- remove(slave_pid);
-
- // spawn
- if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err)) == 0)
- {
- sleep_until_file_exists(slave_pid);
-
- if ((err = wait_for_server_start(bin_dir, user, password, slave_port,
- mysql_tmp_dir)) == 0)
- {
- slave_running = TRUE;
-
- }
- else
- {
- log_error("The slave server went down early.");
-
- }
- }
- else
- {
- log_error("Unable to start slave server.");
-
- }
-
- // free args
- free_args(&al);
-}
-
-/******************************************************************************
-
- mysql_start()
-
- Start the mysql servers.
-
-******************************************************************************/
-void mysql_start()
-{
- log_info("Starting the MySQL server(s): %u", ++restarts);
- start_master();
-
- start_slave();
-
- // activate the test screen
- ActivateScreen(getscreenhandle());
-}
-
-/******************************************************************************
-
- stop_slave()
-
- Stop the slave server.
-
-******************************************************************************/
-void stop_slave()
-{
- int err;
-
- // running?
- if (!slave_running) return;
-
- // stop
- if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,
- mysql_tmp_dir)) == 0)
- {
- slave_running = FALSE;
- }
- else
- {
- log_error("Unable to stop slave server.");
- }
-}
-
-/******************************************************************************
-
- stop_master()
-
- Stop the master server.
-
-******************************************************************************/
-void stop_master()
-{
- int err;
-
- // running?
- if (!master_running) return;
-
- if ((err = stop_server(bin_dir, user, password, master_port, master_pid,
- mysql_tmp_dir)) == 0)
- {
- master_running = FALSE;
- }
- else
- {
- log_error("Unable to stop master server.");
- }
-}
-
-/******************************************************************************
-
- mysql_stop()
-
- Stop the mysql servers.
-
-******************************************************************************/
-void mysql_stop()
-{
- log_info("Stopping the MySQL server(s)...");
- stop_master();
-
- stop_slave();
-
- // activate the test screen
- ActivateScreen(getscreenhandle());
-}
-
-/******************************************************************************
-
- mysql_restart()
-
- Restart the mysql servers.
-
-******************************************************************************/
-void mysql_restart()
-{
- log_info("Restarting the MySQL server(s): %u", ++restarts);
-
- mysql_stop();
-
- mysql_start();
-}
-
-/******************************************************************************
-
- read_option()
-
- Read the option file.
-
-******************************************************************************/
-int read_option(char *opt_file, char *opt)
-{
- int fd, err;
- int result;
- char *p;
- char buf[PATH_MAX];
-
- // copy current option
- strncpy(buf, opt, PATH_MAX);
-
- // open options file
- fd = open(opt_file, O_RDONLY);
-
- err = read(fd, opt, PATH_MAX);
-
- close(fd);
-
- if (err > 0)
- {
- // terminate string
- if ((p = strchr(opt, '\n')) != NULL)
- {
- *p = NULL;
-
- // check for a '\r'
- if ((p = strchr(opt, '\r')) != NULL)
- {
- *p = NULL;
- }
- }
- else
- {
- opt[err] = NULL;
- }
-
- // check for $MYSQL_TEST_DIR
- if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL)
- {
- char temp[PATH_MAX];
-
- *p = NULL;
-
- strcpy(temp, p + strlen("$MYSQL_TEST_DIR"));
-
- strcat(opt, mysql_test_dir);
-
- strcat(opt, temp);
- }
- // Check for double backslash and replace it with single bakslash
- if ((p = strstr(opt, "\\\\")) != NULL)
- {
- /* bmove is guranteed to work byte by byte */
- bmove(p, p+1, strlen(p+1));
- }
- }
- else
- {
- // clear option
- *opt = NULL;
- }
-
- // compare current option with previous
- return strcmp(opt, buf);
-}
-
-/******************************************************************************
-
- run_test()
-
- Run the given test case.
-
-******************************************************************************/
-void run_test(char *test)
-{
- char temp[PATH_MAX];
- char *rstr;
- double elapsed = 0;
- int skip = FALSE, ignore=FALSE;
- int restart = FALSE;
- int flag = FALSE;
- struct stat info;
-
- // skip tests in the skip list
- snprintf(temp, PATH_MAX, " %s ", test);
- skip = (strindex(skip_test, temp) != NULL);
- if (skip == FALSE)
- ignore = (strindex(ignore_test, temp) != NULL);
-
- if (ignore)
- {
- // show test
- log_msg("%-46s ", test);
-
- // ignore
- rstr = TEST_IGNORE;
- ++total_ignore;
- }
- else if (!skip) // skip test?
- {
- char test_file[PATH_MAX];
- char master_opt_file[PATH_MAX];
- char slave_opt_file[PATH_MAX];
- char slave_master_info_file[PATH_MAX];
- char result_file[PATH_MAX];
- char reject_file[PATH_MAX];
- char out_file[PATH_MAX];
- char err_file[PATH_MAX];
- int err;
- arg_list_t al;
- NXTime_t start, stop;
-
- // skip slave?
- flag = skip_slave;
- skip_slave = (strncmp(test, "rpl", 3) != 0);
- if (flag != skip_slave) restart = TRUE;
-
- // create files
- snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test);
- snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test);
- snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test);
- snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX);
- snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX);
- snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX);
-
- // netware specific files
- snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX);
- if (stat(test_file, &info))
- {
- snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX);
- if (access(test_file,0))
- {
- printf("Invalid test name %s, %s file not found\n",test,test_file);
- return;
- }
- }
-
- snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX);
- if (stat(result_file, &info))
- {
- snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX);
- }
-
- // init scripts
- snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test);
- if (stat(master_init_script, &info))
- master_init_script[0] = NULL;
- else
- restart = TRUE;
-
- snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test);
- if (stat(slave_init_script, &info))
- slave_init_script[0] = NULL;
- else
- restart = TRUE;
-
- // read options
- if (read_option(master_opt_file, master_opt)) restart = TRUE;
- if (read_option(slave_opt_file, slave_opt)) restart = TRUE;
- if (read_option(slave_master_info_file, slave_master_info)) restart = TRUE;
-
- // cleanup previous run
- remove(reject_file);
- remove(out_file);
- remove(err_file);
-
- // start or restart?
- if (!master_running) mysql_start();
- else if (restart) mysql_restart();
-
- // let the system stabalize
- sleep(1);
-
- // show test
- log_msg("%-46s ", test);
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqltest_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", master_port);
- add_arg(&al, "--database=%s", db);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "--silent");
- add_arg(&al, "--basedir=%s/", mysql_test_dir);
- add_arg(&al, "--host=127.0.0.1");
- add_arg(&al, "-v");
- add_arg(&al, "-R");
- add_arg(&al, "%s", result_file);
-
- if (use_openssl)
- {
- add_arg(&al, "--ssl-ca=%s", ca_cert);
- add_arg(&al, "--ssl-cert=%s", client_cert);
- add_arg(&al, "--ssl-key=%s", client_key);
- }
-
- // start timer
- NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &start);
-
- // spawn
- err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file);
-
- // stop timer
- NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &stop);
-
- // calculate
- elapsed = ((double)(stop - start)) / NX_USECONDS;
- total_time += elapsed;
-
- // free args
- free_args(&al);
-
- if (err == 0)
- {
- // pass
- rstr = TEST_PASS;
- ++total_pass;
-
- // increment total
- ++total_test;
- }
- else if (err == 62)
- {
- // skip
- rstr = TEST_SKIP;
- ++total_skip;
- }
- else if (err == 1)
- {
- // fail
- rstr = TEST_FAIL;
- ++total_fail;
-
- // increment total
- ++total_test;
- }
- else
- {
- rstr = TEST_BAD;
- }
- }
- else // early skips
- {
- // show test
- log_msg("%-46s ", test);
-
- // skip
- rstr = TEST_SKIP;
- ++total_skip;
- }
-
- // result
- log_msg("%10.06f %-14s\n", elapsed, rstr);
-}
-
-/******************************************************************************
-
- vlog()
-
- Log the message.
-
-******************************************************************************/
-void vlog(char *format, va_list ap)
-{
- vfprintf(stdout, format, ap);
- fflush(stdout);
-
- if (log_fd)
- {
- vfprintf(log_fd, format, ap);
- fflush(log_fd);
- }
-}
-
-/******************************************************************************
-
- log()
-
- Log the message.
-
-******************************************************************************/
-void log_msg(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vlog(format, ap);
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_info()
-
- Log the given information.
-
-******************************************************************************/
-void log_info(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- log_msg("-- INFO : ");
- vlog(format, ap);
- log_msg("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_error()
-
- Log the given error.
-
-******************************************************************************/
-void log_error(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- log_msg("-- ERROR: ");
- vlog(format, ap);
- log_msg("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- log_errno()
-
- Log the given error and errno.
-
-******************************************************************************/
-void log_errno(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- log_msg("-- ERROR: (%003u) ", errno);
- vlog(format, ap);
- log_msg("\n");
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- die()
-
- Exit the application.
-
-******************************************************************************/
-void die(char *msg)
-{
- log_error(msg);
-
- pressanykey();
-
- exit(-1);
-}
-
-/******************************************************************************
-
- setup()
-
- Setup the mysql test enviornment.
-
-******************************************************************************/
-void setup(char *file)
-{
- char temp[PATH_MAX];
- char file_path[PATH_MAX*2];
- char *p;
-
- // set the timezone for the timestamp test
- setenv("TZ", "GMT-3", TRUE);
-
- // find base dir
- strcpy(temp, strlwr(file));
- while((p = strchr(temp, '\\')) != NULL) *p = '/';
-
- if ((p = strindex(temp, "/mysql-test/")) != NULL)
- {
- *p = NULL;
- strcpy(base_dir, temp);
- }
-
- // setup paths
- snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir);
- snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir);
- snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir);
- snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir);
- snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir);
- snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir);
- snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
- snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir);
- snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir);
-
-#ifdef HAVE_OPENSSL
- use_openssl = TRUE;
-#endif // HAVE_OPENSSL
-
- // OpenSSL paths
- snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir);
- snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir);
- snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir);
- snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir);
- snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir);
-
- // setup files
- snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir);
- snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir);
- snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
- snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir);
- snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir);
-
- // create log file
- snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir);
- if ((log_fd = fopen(temp, "w+")) == NULL)
- {
- log_errno("Unable to create log file.");
- }
-
- // prepare skip test list
- while((p = strchr(skip_test, ',')) != NULL) *p = ' ';
- strcpy(temp, strlwr(skip_test));
- snprintf(skip_test, PATH_MAX, " %s ", temp);
-
- // environment
- setenv("MYSQL_TEST_DIR", mysql_test_dir, 1);
- snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port);
- setenv("MYSQL_DUMP", file_path, 1);
- snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir);
- setenv("MYSQL_BINLOG", file_path, 1);
- setenv("MASTER_MYPORT", "9306", 1);
- setenv("SLAVE_MYPORT", "9307", 1);
- snprintf(file_path, PATH_MAX*2, "%d", MYSQL_PORT);
- setenv("MYSQL_TCP_PORT", file_path, 1);
- snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
- setenv("MYSQL_CLIENT_TEST",file_path,1);
- snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
- setenv("MYSQL",file_path,1);
- snprintf(file_path, PATH_MAX*2, "%s/mysqlshow --no-defaults --user=root --port=%u", bin_dir, master_port);
- setenv("MYSQL_SHOW",file_path,1);
- snprintf(file_path, PATH_MAX*2, "%s/mysqlcheck --no-defaults -uroot --port=%u", bin_dir, master_port);
- setenv("MYSQL_CHECK",file_path,1);
-
-}
-
-/******************************************************************************
-
- main()
-
-******************************************************************************/
-int main(int argc, char **argv)
-{
- int is_ignore_list= 0, autoclose= 0, individual_execution= 0;
- // setup
- setup(argv[0]);
-
- /* The --ignore option is comma saperated list of test cases to skip and
- should be very first command line option to the test suite.
-
- The usage is now:
- mysql_test_run --ignore=test1,test2 test3 test4
- where test1 and test2 are test cases to ignore
- and test3 and test4 are test cases to run.
- */
- if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1))
- {
- char *temp, *token;
- temp= strdup(strchr(argv[1],'=') + 1);
- for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ","))
- {
- if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1)
- sprintf(ignore_test+strlen(ignore_test), " %s ", token);
- else
- {
- free(temp);
- die("ignore list too long.");
- }
- }
- free(temp);
- is_ignore_list = 1;
- }
- // header
- log_msg("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
-
- log_msg("Initializing Tests...\n");
-
- // install test databases
- mysql_install_db();
-
- log_msg("Starting Tests...\n");
-
- log_msg("\n");
- log_msg(HEADER);
- log_msg(DASH);
-
- if ( argc > 1 + is_ignore_list )
- {
- int i;
-
- for (i = 1 + is_ignore_list; i < argc; i++)
- {
- if (!strncasecmp(argv[i], "--autoclose", 11))
- {
- autoclose= 1;
- continue;
- }
- // single test
- single_test= TRUE;
- individual_execution= 1;
-
- // run given test
- run_test(argv[i]);
- }
- }
- if (!individual_execution)
- {
- // run all tests
- DIR *dir = opendir(test_dir);
- DIR *entry;
- char test[NAME_MAX];
- char *p;
-
- // single test
- single_test = FALSE;
-
- if (dir == NULL)
- {
- die("Unable to open tests directory.");
- }
-
- while((entry = readdir(dir)) != NULL)
- {
- if (!S_ISDIR(entry->d_type))
- {
- strcpy(test, strlwr(entry->d_name));
-
- // find the test suffix
- if ((p = strindex(test, TEST_SUFFIX)) != NULL)
- {
- // null terminate at the suffix
- *p = '\0';
-
- // run test
- run_test(test);
- }
- }
- }
-
- closedir(dir);
- }
-
- // stop server
- mysql_stop();
-
- log_msg(DASH);
- log_msg("\n");
-
- log_msg("Ending Tests...\n");
-
- // report stats
- report_stats();
-
- // close log
- if (log_fd) fclose(log_fd);
-
- // keep results up
- if (!autoclose)
- pressanykey();
-
- return 0;
-}
-
-/*
- Synopsis:
- This function breaks the string into a sequence of tokens. The difference
- between this function and strtok is that it respects the quoted string i.e.
- it skips any delimiter character within the quoted part of the string.
- It return tokens by eliminating quote character. It modifies the input string
- passed. It will work with whitespace delimeter but may not work properly with
- other delimeter. If the delimeter will contain any quote character, then
- function will not tokenize and will return null string.
- e.g. if input string is
- --init-slave="set global max_connections=500" --skip-external-locking
- then the output will two string i.e.
- --init-slave=set global max_connections=500
- --skip-external-locking
-
-Arguments:
- string: input string
- delim: set of delimiter character
-Output:
- return the null terminated token of NULL.
-*/
-
-
-char *str_tok(char *string, const char *delim)
-{
- char *token; /* current token received from strtok */
- char *qt_token; /* token delimeted by the matching pair of quote */
- /*
- if there are any quote chars found in the token then this variable
- will hold the concatenated string to return to the caller
- */
- char *ptr_token=NULL;
- /* pointer to the quote character in the token from strtok */
- char *ptr_quote=NULL;
-
- /* See if the delimeter contains any quote character */
- if (strchr(delim,'\'') || strchr(delim,'\"'))
- return NULL;
-
- /* repeate till we are getting some token from strtok */
- while ((token = (char*)strtok(string, delim) ) != NULL)
- {
- /*
- make the input string NULL so that next time onward strtok can
- be called with NULL input string.
- */
- string = NULL;
-
- /* check if the current token contain double quote character*/
- if ((ptr_quote = (char*)strchr(token,'\"')) != NULL)
- {
- /*
- get the matching the matching double quote in the remaining
- input string
- */
- qt_token = (char*)strtok(NULL,"\"");
- }
- /* check if the current token contain single quote character*/
- else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL)
- {
- /*
- get the matching the matching single quote in the remaining
- input string
- */
- qt_token = (char*)strtok(NULL,"\'");
- }
-
- /*
- if the current token does not contains any quote character then
- return to the caller.
- */
- if (ptr_quote == NULL)
- {
- /*
- if there is any earlier token i.e. ptr_token then append the
- current token in it and return it else return the current
- token directly
- */
- return ptr_token ? strcat(ptr_token,token) : token;
- }
-
- /*
- remove the quote character i.e. make NULL so that the token will
- be devided in two part and later both part can be concatenated
- and hence quote will be removed
- */
- *ptr_quote= 0;
-
- /* check if ptr_token has been initialized or not */
- if (ptr_token == NULL)
- {
- /* initialize the ptr_token with current token */
- ptr_token= token;
- /* copy entire string between matching pair of quote*/
- sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token);
- }
- else
- {
- /*
- copy the current token and entire string between matching pair
- of quote
- */
- sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1,
- qt_token );
- }
- }
-
- /* return the concatenated token */
- return ptr_token;
-}
diff --git a/netware/mysql_test_run.def b/netware/mysql_test_run.def
deleted file mode 100644
index c8afd305978..00000000000
--- a/netware/mysql_test_run.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Test Run
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Test Run"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Test Run"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
diff --git a/netware/mysql_upgrade.def b/netware/mysql_upgrade.def
deleted file mode 100644
index 7b5718ffb1b..00000000000
--- a/netware/mysql_upgrade.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Admin
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Upgrade Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def
deleted file mode 100644
index 6e9cc76f139..00000000000
--- a/netware/mysql_waitpid.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# Wait for a Program to Terminate
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-#SCREENNAME "MySQL Tool - Wait for a Program to Terminate"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Tool - Wait for a Program to Terminate"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqladmin.def b/netware/mysqladmin.def
deleted file mode 100644
index 03f15dfdd08..00000000000
--- a/netware/mysqladmin.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Admin
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Admin[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Admin Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def
deleted file mode 100644
index 88024acc318..00000000000
--- a/netware/mysqlbinlog.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Binary Log
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Binary Log Dump Tool[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Binary Log Dump Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def
deleted file mode 100644
index b9028c237d1..00000000000
--- a/netware/mysqlcheck.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Client
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Check Tool[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Check Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqld.def b/netware/mysqld.def
deleted file mode 100644
index bb7b8129983..00000000000
--- a/netware/mysqld.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Server
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Database Server"
-VERSION 4, 0
-MULTIPLE
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
deleted file mode 100644
index 2a4268d63ef..00000000000
--- a/netware/mysqld_safe.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/*
- Copyright (c) 2003 Novell, Inc. All Rights Reserved.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <netdb.h>
-#include <sys/stat.h>
-#include <monitor.h>
-#include <strings.h>
-#include <getopt.h>
-#include <screen.h>
-#include <dirent.h>
-
-#include "my_config.h"
-#include "my_manage.h"
-#include "mysql_version.h"
-
-/******************************************************************************
-
- global variables
-
-******************************************************************************/
-char autoclose;
-char basedir[PATH_MAX];
-char checktables;
-char datadir[PATH_MAX];
-char pid_file[PATH_MAX];
-char address[PATH_MAX];
-char port[PATH_MAX];
-char err_log[PATH_MAX];
-char safe_log[PATH_MAX];
-char mysqld[PATH_MAX];
-char hostname[PATH_MAX];
-char default_option[PATH_MAX];
-
-FILE *log_fd= NULL;
-
-/******************************************************************************
-
- prototypes
-
-******************************************************************************/
-
-void usage(void);
-void vlog(char *, va_list);
-void log(char *, ...);
-void start_defaults(int, char *[]);
-void finish_defaults();
-void read_defaults(arg_list_t *);
-void parse_args(int, char *[]);
-void get_options(int, char *[]);
-void check_data_vol();
-void check_setup();
-void check_tables();
-void mysql_start(int, char *[]);
-
-/******************************************************************************
-
- functions
-
-******************************************************************************/
-
-/******************************************************************************
-
- usage()
-
- Show usage.
-
-******************************************************************************/
-void usage(void)
-{
- // keep the screen up
- setscreenmode(SCR_NO_MODE);
-
- puts("\
-\n\
-usage: mysqld_safe [options]\n\
-\n\
-Program to start the MySQL daemon and restart it if it dies unexpectedly.\n\
-All options, besides those listed below, are passed on to the MySQL daemon.\n\
-\n\
-options:\n\
-\n\
---autoclose Automatically close the mysqld_safe screen.\n\
-\n\
---check-tables Check the tables before starting the MySQL daemon.\n\
-\n\
---err-log=<file> Send the MySQL daemon error output to <file>.\n\
-\n\
---help Show this help information.\n\
-\n\
---mysqld=<file> Use the <file> MySQL daemon.\n\
-\n\
- ");
-
- exit(-1);
-}
-
-/******************************************************************************
-
- vlog()
-
- Log the message.
-
-******************************************************************************/
-void vlog(char *format, va_list ap)
-{
- vfprintf(stdout, format, ap);
- fflush(stdout);
-
- if (log_fd)
- {
- vfprintf(log_fd, format, ap);
- fflush(log_fd);
- }
-}
-
-/******************************************************************************
-
- log()
-
- Log the message.
-
-******************************************************************************/
-void log(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
-
- vlog(format, ap);
-
- va_end(ap);
-}
-
-/******************************************************************************
-
- start_defaults()
-
- Start setting the defaults.
-
-******************************************************************************/
-void start_defaults(int argc, char *argv[])
-{
- struct stat buf;
- int i;
-
- // default options
- static char *default_options[]=
- {
- "--no-defaults",
- "--defaults-file=",
- "--defaults-extra-file=",
- NULL
- };
-
- // autoclose
- autoclose= FALSE;
-
- // basedir
- get_basedir(argv[0], basedir);
-
- // check-tables
- checktables= FALSE;
-
- // hostname
- if (gethostname(hostname, PATH_MAX) < 0)
- {
- // default
- strcpy(hostname, "mysql");
- }
-
- // address
- snprintf(address, PATH_MAX, "0.0.0.0");
-
- // port
- snprintf(port, PATH_MAX, "%d", MYSQL_PORT);
-
- // default option
- default_option[0]= NULL;
- for (i= 0; (argc > 1) && default_options[i]; i++)
- {
- if (!strnicmp(argv[1], default_options[i], strlen(default_options[i])))
- {
- strncpy(default_option, argv[1], PATH_MAX);
- break;
- }
- }
-
- // set after basedir is established
- datadir[0]= NULL;
- pid_file[0]= NULL;
- err_log[0]= NULL;
- safe_log[0]= NULL;
- mysqld[0]= NULL;
-}
-
-/******************************************************************************
-
- finish_defaults()
-
- Finish settig the defaults.
-
-******************************************************************************/
-void finish_defaults()
-{
- struct stat buf;
- int i;
-
- // datadir
- if (!datadir[0])
- snprintf(datadir, PATH_MAX, "%s/data", basedir);
-
- // pid-file
- if (!pid_file[0])
- snprintf(pid_file, PATH_MAX, "%s/%s.pid", datadir, hostname);
-
- // err-log
- if (!err_log[0])
- snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname);
-
- // safe-log
- if (!safe_log[0])
- snprintf(safe_log, PATH_MAX, "%s/%s.safe", datadir, hostname);
-
- // mysqld
- if (!mysqld[0])
- snprintf(mysqld, PATH_MAX, "%s/bin/mysqld-max", basedir);
-
- if (stat(mysqld, &buf))
- {
- snprintf(mysqld, PATH_MAX, "%s/bin/mysqld", basedir);
- }
-}
-
-/******************************************************************************
-
- read_defaults()
-
- Read the defaults.
-
-******************************************************************************/
-void read_defaults(arg_list_t *pal)
-{
- arg_list_t al;
- char defaults_file[PATH_MAX];
- char mydefaults[PATH_MAX];
- char line[PATH_MAX];
- FILE *fp;
-
- // defaults output file
- snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
- remove(defaults_file);
-
- // mysqladmin file
- snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
-
- // args
- init_args(&al);
- add_arg(&al, mydefaults);
- if (default_option[0])
- add_arg(&al, default_option);
- add_arg(&al, "mysqld");
- add_arg(&al, "server");
- add_arg(&al, "mysqld_safe");
- add_arg(&al, "safe_mysqld");
-
- spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL);
-
- free_args(&al);
-
- // gather defaults
- if ((fp= fopen(defaults_file, "r")) != NULL)
- {
- while (fgets(line, PATH_MAX, fp))
- {
- char *p;
-
- // remove end-of-line character
- if ((p= strrchr(line, '\n')) != NULL)
- *p= '\0';
-
- // add the option as an argument
- add_arg(pal, line);
- }
-
- fclose(fp);
- }
-
- // remove file
- remove(defaults_file);
-}
-
-/******************************************************************************
-
- parse_args()
-
- Get the options.
-
-******************************************************************************/
-void parse_args(int argc, char *argv[])
-{
- int index= 0;
- int c;
-
- // parse options
- enum opts
- {
- OPT_BASEDIR= 0xFF,
- OPT_DATADIR,
- OPT_PID_FILE,
- OPT_BIND_ADDRESS,
- OPT_PORT,
- OPT_ERR_LOG,
- OPT_SAFE_LOG,
- OPT_MYSQLD,
- OPT_HELP
- };
-
- static struct option options[]=
- {
- {"autoclose", no_argument, &autoclose, TRUE},
- {"basedir", required_argument, 0, OPT_BASEDIR},
- {"check-tables", no_argument, &checktables, TRUE},
- {"datadir", required_argument, 0, OPT_DATADIR},
- {"pid-file", required_argument, 0, OPT_PID_FILE},
- {"bind-address", required_argument, 0, OPT_BIND_ADDRESS},
- {"port", required_argument, 0, OPT_PORT},
- {"err-log", required_argument, 0, OPT_ERR_LOG},
- {"safe-log", required_argument, 0, OPT_SAFE_LOG},
- {"mysqld", required_argument, 0, OPT_MYSQLD},
- {"help", no_argument, 0, OPT_HELP},
- {0, 0, 0, 0}
- };
-
- // we have to reset getopt_long because we use it multiple times
- optind= 1;
-
- // turn off error reporting
- opterr= 0;
-
- while ((c= getopt_long(argc, argv, "b:h:P:", options, &index)) >= 0)
- {
- switch (c) {
- case OPT_BASEDIR:
- case 'b':
- strcpy(basedir, optarg);
- break;
-
- case OPT_DATADIR:
- case 'h':
- strcpy(datadir, optarg);
- break;
-
- case OPT_PID_FILE:
- strcpy(pid_file, optarg);
- break;
-
- case OPT_BIND_ADDRESS:
- strcpy(address, optarg);
- break;
-
- case OPT_PORT:
- case 'P':
- strcpy(port, optarg);
- break;
-
- case OPT_ERR_LOG:
- strcpy(err_log, optarg);
- break;
-
- case OPT_SAFE_LOG:
- strcpy(safe_log, optarg);
- break;
-
- case OPT_MYSQLD:
- strcpy(mysqld, optarg);
- break;
-
- case OPT_HELP:
- usage();
- break;
-
- default:
- // ignore
- break;
- }
- }
-}
-
-
-/******************************************************************************
-
-
-
-/******************************************************************************
-
- get_options()
-
- Get the options.
-
-******************************************************************************/
-void get_options(int argc, char *argv[])
-{
- arg_list_t al;
-
- // start defaults
- start_defaults(argc, argv);
-
- // default file arguments
- init_args(&al);
- add_arg(&al, "ignore");
- read_defaults(&al);
- parse_args(al.argc, al.argv);
- free_args(&al);
-
- // command-line arguments
- parse_args(argc, argv);
-
- // finish defaults
- finish_defaults();
-}
-
-/******************************************************************************
-
- check_data_vol()
-
- Check the database volume.
-
-******************************************************************************/
-void check_data_vol()
-{
- // warn if the data is on a Traditional volume
- struct volume_info vol;
- char buff[PATH_MAX];
- char *p;
-
- // clear struct
- memset(&vol, 0, sizeof(vol));
-
- // find volume name
- strcpy(buff, datadir);
- if (p= strchr(buff, ':'))
- {
- // terminate after volume name
- *p= 0;
- }
- else
- {
- // assume SYS volume
- strcpy(buff, "SYS");
- }
-
- // retrieve information
- netware_vol_info_from_name(&vol, buff);
-
- if ((vol.flags & VOL_NSS_PRESENT) == 0)
- {
- log("Error: Either the data directory does not exist or is not on an NSS volume!\n\n");
- exit(-1);
- }
-}
-
-/******************************************************************************
-
- check_setup()
-
- Check the current setup.
-
-******************************************************************************/
-void check_setup()
-{
- struct stat info;
- char temp[PATH_MAX];
-
- // remove any current pid_file
- if (!stat(pid_file, &info) && (remove(pid_file) < 0))
- {
- log("ERROR: Unable to remove current pid file!\n\n");
- exit(-1);
- }
-
- // check the data volume
- check_data_vol();
-
- // check for a database
- snprintf(temp, PATH_MAX, "%s/mysql/host.frm", datadir);
- if (stat(temp, &info))
- {
- log("ERROR: No database found in the data directory!\n\n");
- exit(-1);
- }
-}
-
-/******************************************************************************
-
- check_tables()
-
- Check the database tables.
-
-******************************************************************************/
-void check_tables()
-{
- arg_list_t al;
- char mycheck[PATH_MAX];
- char table[PATH_MAX];
- char db[PATH_MAX];
- DIR *datadir_entry, *db_entry, *table_entry;
-
- // status
- log("checking tables...\n");
-
- // list databases
- if ((datadir_entry= opendir(datadir)) == NULL)
- {
- return;
- }
-
- while ((db_entry= readdir(datadir_entry)) != NULL)
- {
- if (db_entry->d_name[0] == '.')
- {
- // Skip
- }
- else if (S_ISDIR(db_entry->d_type))
- {
- // create long db name
- snprintf(db, PATH_MAX, "%s/%s", datadir, db_entry->d_name);
-
- // list tables
- if ((db_entry= opendir(db)) == NULL)
- {
- continue;
- }
-
- while ((table_entry= readdir(db_entry)) != NULL)
- {
- // create long table name
- snprintf(table, PATH_MAX, "%s/%s", db, strlwr(table_entry->d_name));
-
- if (strindex(table, ".myi"))
- {
- // ** myisamchk
-
- // mysqladmin file
- snprintf(mycheck, PATH_MAX, "%s/bin/myisamchk", basedir);
-
- // args
- init_args(&al);
- add_arg(&al, mycheck);
- add_arg(&al, "--silent");
- add_arg(&al, "--force");
- add_arg(&al, "--fast");
- add_arg(&al, "--medium-check");
- add_arg(&al, "--key_buffer=64M");
- add_arg(&al, "--sort_buffer=64M");
- add_arg(&al, table);
-
- spawn(mycheck, &al, TRUE, NULL, NULL, NULL);
-
- free_args(&al);
- }
- else if (strindex(table, ".ism"))
- {
- // ** isamchk
-
- // mysqladmin file
- snprintf(mycheck, PATH_MAX, "%s/bin/isamchk", basedir);
-
- // args
- init_args(&al);
- add_arg(&al, mycheck);
- add_arg(&al, "--silent");
- add_arg(&al, "--force");
- add_arg(&al, "--sort_buffer=64M");
- add_arg(&al, table);
-
- spawn(mycheck, &al, TRUE, NULL, NULL, NULL);
-
- free_args(&al);
- }
- }
- }
- }
-}
-
-/******************************************************************************
-
- mysql_start()
-
- Start the mysql server.
-
-******************************************************************************/
-void mysql_start(int argc, char *argv[])
-{
- arg_list_t al;
- int i, j, err;
- struct stat info;
- time_t cal;
- struct tm lt;
- char stamp[PATH_MAX];
- char skip;
-
- // private options
- static char *private_options[]=
- {
- "--autoclose",
- "--check-tables",
- "--help",
- "--err-log=",
- "--mysqld=",
- NULL
- };
-
- // args
- init_args(&al);
- add_arg(&al, "%s", mysqld);
-
- // parent args
- for (i= 1; i < argc; i++)
- {
- skip= FALSE;
-
- // skip private arguments
- for (j= 0; private_options[j]; j++)
- {
- if (!strnicmp(argv[i], private_options[j], strlen(private_options[j])))
- {
- skip= TRUE;
- break;
- }
- }
-
- if (!skip)
- {
- add_arg(&al, "%s", argv[i]);
- }
- }
- // spawn
- do
- {
- // check the database tables
- if (checktables)
- check_tables();
-
- // status
- time(&cal);
- localtime_r(&cal, &lt);
- strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", &lt);
- log("mysql started : %s\n", stamp);
-
- // spawn mysqld
- spawn(mysqld, &al, TRUE, NULL, NULL, err_log);
- }
- while (!stat(pid_file, &info));
-
- // status
- time(&cal);
- localtime_r(&cal, &lt);
- strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", &lt);
- log("mysql stopped : %s\n\n", stamp);
-
- // free args
- free_args(&al);
-}
-
-/******************************************************************************
-
- main()
-
-******************************************************************************/
-int main(int argc, char **argv)
-{
- char temp[PATH_MAX];
-
- // get the options
- get_options(argc, argv);
-
- // keep the screen up
- if (!autoclose)
- setscreenmode(SCR_NO_MODE);
-
- // create log file
- log_fd= fopen(safe_log, "w+");
-
- // header
- log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
-
- // status
- log("address : %s\n", address);
- log("port : %s\n", port);
- log("daemon : %s\n", mysqld);
- log("base directory : %s\n", basedir);
- log("data directory : %s\n", datadir);
- log("pid file : %s\n", pid_file);
- log("error file : %s\n", err_log);
- log("log file : %s\n", safe_log);
- log("\n");
-
- // check setup
- check_setup();
-
- // start the MySQL server
- mysql_start(argc, argv);
-
- // close log file
- if (log_fd)
- fclose(log_fd);
-
- return 0;
-}
diff --git a/netware/mysqld_safe.def b/netware/mysqld_safe.def
deleted file mode 100644
index 5c436cc97ca..00000000000
--- a/netware/mysqld_safe.def
+++ /dev/null
@@ -1,13 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQLd Safe
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Database Server"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Database Server Monitor"
-VERSION 4, 0
-STACKSIZE 131072
-MULTIPLE
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqldump.def b/netware/mysqldump.def
deleted file mode 100644
index 2e745492cf3..00000000000
--- a/netware/mysqldump.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Admin
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Dump Tool[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Dump Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def
deleted file mode 100644
index 5db6b940ce7..00000000000
--- a/netware/mysqlimport.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Client
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Import[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Import Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqlshow.def b/netware/mysqlshow.def
deleted file mode 100644
index 386cb98c091..00000000000
--- a/netware/mysqlshow.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Show
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Show[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Show Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqlslap.def b/netware/mysqlslap.def
deleted file mode 100644
index be10f9db192..00000000000
--- a/netware/mysqlslap.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Slap
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-SCREENNAME "MySQL Slap[scrollable]"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Slap Tool"
-VERSION 4, 0
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/mysqltest.def b/netware/mysqltest.def
deleted file mode 100644
index f0ee5f7e6a4..00000000000
--- a/netware/mysqltest.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# MySQL Admin
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Test Case Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/perror.def b/netware/perror.def
deleted file mode 100644
index fc95de3476a..00000000000
--- a/netware/perror.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# PERROR
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Error Code Description Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/replace.def b/netware/replace.def
deleted file mode 100644
index 7feccdbff41..00000000000
--- a/netware/replace.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# Replace
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Text Replacement Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def
deleted file mode 100644
index 20098c1b4e0..00000000000
--- a/netware/resolve_stack_dump.def
+++ /dev/null
@@ -1,12 +0,0 @@
-#------------------------------------------------------------------------------
-# Resolve Stack Dump
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-#SCREENNAME "MySQL Stack Dump Resolve Tool"
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL Stack Dump Resolve Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/resolveip.def b/netware/resolveip.def
deleted file mode 100644
index 1962d61be53..00000000000
--- a/netware/resolveip.def
+++ /dev/null
@@ -1,11 +0,0 @@
-#------------------------------------------------------------------------------
-# Resolve IP
-#------------------------------------------------------------------------------
-MODULE libc.nlm
-COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
-DESCRIPTION "MySQL IP/Hostname Resolve Tool"
-VERSION 4, 0
-STACKSIZE 131072
-XDCDATA ../netware/mysql.xdc
-#DEBUG
-
diff --git a/netware/static_init_db.sql b/netware/static_init_db.sql
deleted file mode 100644
index e9fb92f4a97..00000000000
--- a/netware/static_init_db.sql
+++ /dev/null
@@ -1,34 +0,0 @@
-CREATE DATABASE mysql;
-CREATE DATABASE test;
-
-USE mysql;
-
-CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges';
-
-INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
-INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
-
-CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges';
-
-CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges';
-
-INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
-INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
-
-INSERT INTO user (host,user) values ('localhost','');
-INSERT INTO user (host,user) values ('','');
-
-CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
-
-CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
-
-CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';
-
-
-CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics';
-
-CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories';
-
-CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords';
-
-CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation';