summaryrefslogtreecommitdiff
path: root/netware
diff options
context:
space:
mode:
Diffstat (limited to 'netware')
-rwxr-xr-xnetware/BUILD/compile-netware-START2
-rwxr-xr-xnetware/BUILD/mwenv12
-rw-r--r--netware/mysql_fix_privilege_tables.pl125
-rw-r--r--netware/mysqld_safe.c54
4 files changed, 184 insertions, 9 deletions
diff --git a/netware/BUILD/compile-netware-START b/netware/BUILD/compile-netware-START
index ceac111b36c..2941d8868e4 100755
--- a/netware/BUILD/compile-netware-START
+++ b/netware/BUILD/compile-netware-START
@@ -17,7 +17,7 @@ set -e
base_configs=" \
--host=i686-pc-netware \
--enable-local-infile \
- --with-extra-charsets=latin1_de \
+ --with-extra-charsets=all \
--prefix=N:/mysql \
"
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index d37a3ed5472..d2b64409c88 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -1,18 +1,18 @@
#! /bin/sh
-# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be correct before compiling
+# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be changed before compiling
# This values are normally changed by the nwbootstrap script
-# the default is "F:/mydev"
+# the default for WINE_BUILD_DIR is "F:/mydev"
export MYDEV="WINE_BUILD_DIR"
-export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4"
-export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4"
-export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a"
+export MWCNWx86Includes="$MYDEV/libc/include"
+export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib"
+export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib"
export WINEPATH="$MYDEV/mw/bin"
-# the default added path is "$HOME/mydev/mysql-x.x-x/netware/BUILD"
+# the default for BUILD_DIR is "$HOME/mydev"
export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD"
export AR='mwldnlm'
diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl
new file mode 100644
index 00000000000..fd5bc11dde1
--- /dev/null
+++ b/netware/mysql_fix_privilege_tables.pl
@@ -0,0 +1,125 @@
+#-----------------------------------------------------------------------------
+# 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; 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
+#-----------------------------------------------------------------------------
+
+#-----------------------------------------------------------------------------
+# 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
+#-----------------------------------------------------------------------------
+
+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<>''; \
+");
+
+#-----------------------------------------------------------------------------
+# 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; \
+");
+
+#-----------------------------------------------------------------------------
+# 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; \
+");
+
+#-----------------------------------------------------------------------------
+# done
+#-----------------------------------------------------------------------------
+
+print "\n\nAll done!\n\n";
+
+print "Thanks for using MySQL!\n\n";
+
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
index 59c40eb61e6..1ab90775e02 100644
--- a/netware/mysqld_safe.c
+++ b/netware/mysqld_safe.c
@@ -36,6 +36,7 @@
******************************************************************************/
char autoclose;
char basedir[PATH_MAX];
+char checktables;
char datadir[PATH_MAX];
char pid_file[PATH_MAX];
char address[PATH_MAX];
@@ -54,6 +55,7 @@ FILE *log_fd = NULL;
******************************************************************************/
+void usage(void);
void vlog(char *, va_list);
void log(char *, ...);
void start_defaults(int, char*[]);
@@ -74,6 +76,42 @@ void mysql_start(int, char*[]);
/******************************************************************************
+ 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.
@@ -136,6 +174,9 @@ void start_defaults(int argc, char *argv[])
// basedir
get_basedir(argv[0], basedir);
+ // check-tables
+ checktables = FALSE;
+
// hostname
if (gethostname(hostname,PATH_MAX) < 0)
{
@@ -279,13 +320,15 @@ void parse_args(int argc, char *argv[])
OPT_PORT,
OPT_ERR_LOG,
OPT_SAFE_LOG,
- OPT_MYSQLD
+ 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},
@@ -293,6 +336,7 @@ void parse_args(int argc, char *argv[])
{"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}
};
@@ -341,6 +385,10 @@ void parse_args(int argc, char *argv[])
strcpy(mysqld, optarg);
break;
+ case OPT_HELP:
+ usage();
+ break;
+
default:
// ignore
break;
@@ -563,6 +611,8 @@ void mysql_start(int argc, char *argv[])
static char *private_options[] =
{
"--autoclose",
+ "--check-tables",
+ "--help",
"--err-log=",
"--mysqld=",
NULL
@@ -594,7 +644,7 @@ void mysql_start(int argc, char *argv[])
do
{
// check the database tables
- check_tables();
+ if (checktables) check_tables();
// status
time(&cal);