WL#5486: Remove code for unsupported platforms

Remove Netware specific code.
This commit is contained in:
Davi Arnaut 2010-07-15 08:13:30 -03:00
parent 508522e5f7
commit f54a118249
155 changed files with 297 additions and 7110 deletions

View File

@ -27,7 +27,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@pstack_dir@ libservices \ @pstack_dir@ libservices \
@sql_union_dirs@ unittest \ @sql_union_dirs@ unittest \
@sql_server@ @man_dirs@ tests \ @sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \ @libmysqld_dirs@ \
mysql-test support-files sql-bench \ mysql-test support-files sql-bench \
win \ win \
cmake cmake
@ -36,7 +36,7 @@ DIST_SUBDIRS = . include Docs zlib \
pstack libservices \ pstack libservices \
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \ strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \ vio sql man tests \
netware libmysqld \ libmysqld \
mysql-test support-files sql-bench \ mysql-test support-files sql-bench \
win \ win \
cmake \ cmake \

View File

@ -60,7 +60,7 @@ enum options_client
OPT_IMPORT_USE_THREADS, OPT_IMPORT_USE_THREADS,
OPT_MYSQL_NUMBER_OF_QUERY, OPT_MYSQL_NUMBER_OF_QUERY,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA, OPT_TZ_UTC, OPT_CREATE_SLAP_SCHEMA,
OPT_MYSQLDUMP_SLAVE_APPLY, OPT_MYSQLDUMP_SLAVE_APPLY,
OPT_MYSQLDUMP_SLAVE_DATA, OPT_MYSQLDUMP_SLAVE_DATA,
OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT, OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,

View File

@ -91,7 +91,7 @@ extern "C" {
#undef bcmp // Fix problem with new readline #undef bcmp // Fix problem with new readline
#if defined(__WIN__) #if defined(__WIN__)
#include <conio.h> #include <conio.h>
#elif !defined(__NETWARE__) #else
#include <readline/readline.h> #include <readline/readline.h>
#define HAVE_READLINE #define HAVE_READLINE
#endif #endif
@ -109,7 +109,7 @@ extern "C" {
#define cmp_database(cs,A,B) strcmp((A),(B)) #define cmp_database(cs,A,B) strcmp((A),(B))
#endif #endif
#if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD) #if !defined(__WIN__) && !defined(THREAD)
#define USE_POPEN #define USE_POPEN
#endif #endif
@ -1365,10 +1365,6 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
{"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, {"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-rehash", OPT_AUTO_REHASH, {"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table " "Enable automatic rehashing. One doesn't need to use 'rehash' to get table "
"and field completion, but startup and reconnecting may take a longer time. " "and field completion, but startup and reconnecting may take a longer time. "
@ -1582,11 +1578,6 @@ static struct my_option my_long_options[] =
static void usage(int version) static void usage(int version)
{ {
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#endif
#if defined(USE_LIBEDIT_INTERFACE) #if defined(USE_LIBEDIT_INTERFACE)
const char* readline= ""; const char* readline= "";
#else #else
@ -1609,10 +1600,6 @@ static void usage(int version)
my_print_help(my_long_options); my_print_help(my_long_options);
print_defaults("my", load_default_groups); print_defaults("my", load_default_groups);
my_print_variables(my_long_options); my_print_variables(my_long_options);
NETWARE_SET_SCREEN_MODE(1);
#ifdef __NETWARE__
#undef printf
#endif
} }
@ -1621,11 +1608,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
{ {
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case OPT_CHARSETS_DIR: case OPT_CHARSETS_DIR:
strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1); strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
charsets_dir = mysql_charsets_dir; charsets_dir = mysql_charsets_dir;
@ -1851,10 +1833,6 @@ static int get_options(int argc, char **argv)
static int read_and_execute(bool interactive) static int read_and_execute(bool interactive)
{ {
#if defined(__NETWARE__)
char linebuffer[254];
String buffer;
#endif
#if defined(__WIN__) #if defined(__WIN__)
String tmpbuf; String tmpbuf;
String buffer; String buffer;
@ -1900,18 +1878,8 @@ static int read_and_execute(bool interactive)
if (opt_outfile && glob_buffer.is_empty()) if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE); fflush(OUTFILE);
#if defined(__WIN__) || defined(__NETWARE__) #if defined(__WIN__)
tee_fputs(prompt, stdout); tee_fputs(prompt, stdout);
#if defined(__NETWARE__)
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
/* Remove the '\n' */
if (line)
{
char *p = strrchr(line, '\n');
if (p != NULL)
*p = '\0';
}
#else
if (!tmpbuf.is_alloced()) if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535); tmpbuf.alloc(65535);
tmpbuf.length(0); tmpbuf.length(0);
@ -1932,12 +1900,11 @@ static int read_and_execute(bool interactive)
*/ */
if (line) if (line)
line= buffer.c_ptr(); line= buffer.c_ptr();
#endif /* __NETWARE__ */
#else #else
if (opt_outfile) if (opt_outfile)
fputs(prompt, OUTFILE); fputs(prompt, OUTFILE);
line= readline(prompt); line= readline(prompt);
#endif /* defined(__WIN__) || defined(__NETWARE__) */ #endif /* defined(__WIN__) */
/* /*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
@ -1985,10 +1952,8 @@ static int read_and_execute(bool interactive)
} }
} }
#if defined(__WIN__) || defined(__NETWARE__)
buffer.free();
#endif
#if defined(__WIN__) #if defined(__WIN__)
buffer.free();
tmpbuf.free(); tmpbuf.free();
#endif #endif
@ -3945,8 +3910,6 @@ static int
com_quit(String *buffer __attribute__((unused)), com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused))) char *line __attribute__((unused)))
{ {
/* let the screen auto close on a normal shutdown */
NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT);
status.exit_status=0; status.exit_status=0;
return 1; return 1;
} }
@ -4664,7 +4627,6 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{ {
va_list args; va_list args;
NETWARE_YIELD;
va_start(args, fmt); va_start(args, fmt);
(void) vfprintf(file, fmt, args); (void) vfprintf(file, fmt, args);
va_end(args); va_end(args);
@ -4680,7 +4642,6 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file) void tee_fputs(const char *s, FILE *file)
{ {
NETWARE_YIELD;
fputs(s, file); fputs(s, file);
if (opt_outfile) if (opt_outfile)
fputs(s, OUTFILE); fputs(s, OUTFILE);
@ -4689,7 +4650,6 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file) void tee_puts(const char *s, FILE *file)
{ {
NETWARE_YIELD;
fputs(s, file); fputs(s, file);
fputc('\n', file); fputc('\n', file);
if (opt_outfile) if (opt_outfile)
@ -4706,7 +4666,7 @@ void tee_putc(int c, FILE *file)
putc(c, OUTFILE); putc(c, OUTFILE);
} }
#if defined(__WIN__) || defined(__NETWARE__) #if defined(__WIN__)
#include <time.h> #include <time.h>
#else #else
#include <sys/times.h> #include <sys/times.h>
@ -4718,8 +4678,8 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void) static ulong start_timer(void)
{ {
#if defined(__WIN__) || defined(__NETWARE__) #if defined(__WIN__)
return clock(); return clock();
#else #else
struct tms tms_tmp; struct tms tms_tmp;
return times(&tms_tmp); return times(&tms_tmp);

View File

@ -57,8 +57,6 @@ static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
static my_bool opt_write_binlog; static my_bool opt_write_binlog;
#include <help_start.h>
static struct my_option my_long_options[]= static struct my_option my_long_options[]=
{ {
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
@ -139,8 +137,6 @@ static struct my_option my_long_options[]=
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
#include <help_end.h>
static void free_used_memory(void) static void free_used_memory(void)
{ {
@ -809,9 +805,6 @@ int main(int argc, char **argv)
char self_name[FN_REFLEN]; char self_name[FN_REFLEN];
MY_INIT(argv[0]); MY_INIT(argv[0]);
#ifdef __NETWARE__
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif
#if __WIN__ #if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0) if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)

View File

@ -116,10 +116,6 @@ static TYPELIB command_typelib=
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"count", 'c', {"count", 'c',
"Number of iterations to make. This works with -i (--sleep) only.", "Number of iterations to make. This works with -i (--sleep) only.",
&nr_iterations, &nr_iterations, 0, GET_UINT, &nr_iterations, &nr_iterations, 0, GET_UINT,
@ -222,11 +218,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int error = 0; int error = 0;
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'c': case 'c':
opt_count_iterations= 1; opt_count_iterations= 1;
break; break;
@ -1068,13 +1059,11 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 0; return 0;
} }
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION, printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -1118,7 +1107,6 @@ static void usage(void)
version Get version info from server"); version Get version info from server");
} }
#include <help_end.h>
static int drop_db(MYSQL *mysql, const char *db) static int drop_db(MYSQL *mysql, const char *db)
{ {

View File

@ -1002,10 +1002,6 @@ static struct my_option my_long_options[] =
{ {
{"help", '?', "Display this help and exit.", {"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"base64-output", OPT_BASE64_OUTPUT_MODE, {"base64-output", OPT_BASE64_OUTPUT_MODE,
/* 'unspec' is not mentioned because it is just a placeholder. */ /* 'unspec' is not mentioned because it is just a placeholder. */
"Determine when the output statements should be base64-encoded BINLOG " "Determine when the output statements should be base64-encoded BINLOG "
@ -1233,12 +1229,10 @@ static void cleanup()
mysql_close(mysql); mysql_close(mysql);
} }
#include <help_start.h>
static void print_version() static void print_version()
{ {
printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -1280,7 +1274,6 @@ static my_time_t convert_str_to_timestamp(const char* str)
my_system_gmt_sec(&l_time, &dummy_my_timezone, &dummy_in_dst_time_gap); my_system_gmt_sec(&l_time, &dummy_my_timezone, &dummy_in_dst_time_gap);
} }
#include <help_end.h>
extern "C" my_bool extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -1288,11 +1281,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
{ {
bool tty_password=0; bool tty_password=0;
switch (optid) { switch (optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
case '#': case '#':
DBUG_PUSH(argument ? argument : default_dbug_option); DBUG_PUSH(argument ? argument : default_dbug_option);

View File

@ -62,10 +62,6 @@ static struct my_option my_long_options[] =
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.", "Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
&opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0, &opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0}, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-repair", OPT_AUTO_REPAIR, {"auto-repair", OPT_AUTO_REPAIR,
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.", "If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
&opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0, &opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
@ -208,13 +204,11 @@ static uint fixed_name_length(const char *name);
static char *fix_table_name(char *dest, char *src); static char *fix_table_name(char *dest, char *src);
int what_to_do = 0; int what_to_do = 0;
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */ } /* print_version */
@ -245,18 +239,12 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} /* usage */ } /* usage */
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
{ {
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'a': case 'a':
what_to_do = DO_ANALYZE; what_to_do = DO_ANALYZE;
break; break;

View File

@ -212,10 +212,6 @@ static struct my_option my_long_options[] =
"Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.", "Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.",
&opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG, &opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir, "Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -531,7 +527,6 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
static int dump_tablespaces_for_databases(char** databases); static int dump_tablespaces_for_databases(char** databases);
static int dump_tablespaces(char* ts_where); static int dump_tablespaces(char* ts_where);
#include <help_start.h>
/* /*
Print the supplied message if in verbose mode Print the supplied message if in verbose mode
@ -575,7 +570,6 @@ static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */ } /* print_version */
@ -585,7 +579,6 @@ static void short_usage_sub(void)
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n", printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
my_progname); my_progname);
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname); printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -608,8 +601,6 @@ static void short_usage(void)
printf("For more options, use %s --help\n", my_progname); printf("For more options, use %s --help\n", my_progname);
} }
#include <help_end.h>
static void write_header(FILE *sql_file, char *db_name) static void write_header(FILE *sql_file, char *db_name)
{ {
@ -728,11 +719,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
{ {
switch (optid) { switch (optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */ argument= (char*) ""; /* Don't require password */

View File

@ -67,10 +67,6 @@ static char *shared_memory_base_name=0;
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR, {"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir, "Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -184,13 +180,11 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqlimport","client",0 }; static const char *load_default_groups[]= { "mysqlimport","client",0 };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname, printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname,
IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -212,18 +206,12 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
{ {
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'p': case 'p':
if (argument == disabled_my_option) if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */ argument= (char*) ""; /* Don't require password */

View File

@ -160,10 +160,6 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", 'c', "Directory for character set files.", {"character-sets-dir", 'c', "Directory for character set files.",
&charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, &charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0}, 0, 0, 0, 0, 0},
@ -240,14 +236,11 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -270,18 +263,12 @@ are shown.");
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
{ {
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'v': case 'v':
opt_verbose++; opt_verbose++;
break; break;

View File

@ -676,8 +676,6 @@ static struct my_option my_long_options[] =
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION,
@ -696,7 +694,6 @@ static void usage(void)
my_print_help(my_long_options); my_print_help(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -704,11 +701,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
{ {
DBUG_ENTER("get_one_option"); DBUG_ENTER("get_one_option");
switch(optid) { switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'v': case 'v':
verbose++; verbose++;
break; break;

View File

@ -3707,7 +3707,6 @@ void do_send_quit(struct st_command *command)
void do_change_user(struct st_command *command) void do_change_user(struct st_command *command)
{ {
MYSQL *mysql = &cur_con->mysql; MYSQL *mysql = &cur_con->mysql;
/* static keyword to make the NetWare compiler happy. */
static DYNAMIC_STRING ds_user, ds_passwd, ds_db; static DYNAMIC_STRING ds_user, ds_passwd, ds_db;
const struct command_arg change_user_args[] = { const struct command_arg change_user_args[] = {
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" }, { "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
@ -6006,8 +6005,6 @@ static struct my_option my_long_options[] =
}; };
#include <help_start.h>
void print_version(void) void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION,
@ -6026,8 +6023,6 @@ void usage()
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
/* /*
Read arguments for embedded server and put them into Read arguments for embedded server and put them into

View File

@ -617,25 +617,19 @@ fi
AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [ AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [
case $SYSTEM_TYPE in CXX_VERSION=`$CXX --version | sed 1q`
*netware*) if test $? -ne "0" -o -z "$CXX_VERSION"
CXX_VERSION=`$CXX -version | grep -i version` then
;; CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
*) fi
CXX_VERSION=`$CXX --version | sed 1q` if test $? -ne "0" -o -z "$CXX_VERSION"
if test $? -ne "0" -o -z "$CXX_VERSION" then
then CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI fi
fi if test $? -ne "0" -o -z "$CXX_VERSION"
if test $? -ne "0" -o -z "$CXX_VERSION" then
then CXX_VERSION=""
CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha fi
fi
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=""
fi
esac
if test "$CXX_VERSION" if test "$CXX_VERSION"
then then
AC_MSG_CHECKING("C++ compiler version") AC_MSG_CHECKING("C++ compiler version")

View File

@ -226,14 +226,7 @@ AC_PROG_CXX
AC_PROG_CPP AC_PROG_CPP
# Print version of CC and CXX compiler (if they support --version) # Print version of CC and CXX compiler (if they support --version)
case $SYSTEM_TYPE in
*netware*)
CC_VERSION=`$CC -version | grep -i version`
;;
*)
CC_VERSION=`$CC --version | sed 1q` CC_VERSION=`$CC --version | sed 1q`
;;
esac
if test $? -eq "0" if test $? -eq "0"
then then
AC_MSG_CHECKING("C Compiler version") AC_MSG_CHECKING("C Compiler version")
@ -458,15 +451,10 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln) AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln. # This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln) AC_PATH_PROG(LN_CP_F, ln, ln)
case $SYSTEM_TYPE in # If ln -f does not exists use -s (AFS systems)
*netware*) ;; if test -n "$LN_CP_F"; then
*) LN_CP_F="$LN_CP_F -s"
# If ln -f does not exists use -s (AFS systems) fi
if test -n "$LN_CP_F"; then
LN_CP_F="$LN_CP_F -s"
fi
;;
esac
AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(RM, rm, rm)
@ -550,9 +538,6 @@ else
*cygwin*) *cygwin*)
FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null" FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
;; ;;
*netware*)
FIND_PROC=
;;
*) *)
AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.]) AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
esac esac
@ -1354,98 +1339,6 @@ dnl Is this the right match for DEC OSF on alpha?
# fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler # fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
;; ;;
*netware*)
# No need for curses library so set it to null
with_named_curses=""
# No thread library - in LibC
with_named_thread=""
#
# Edit Makefile.in files.
#
echo -n "configuring Makefile.in files for NetWare... "
for file in sql/Makefile.in extra/Makefile.in client/Makefile.in
do
# echo "#### $file ####"
filedir="`dirname $file`"
filebase="`basename $file`"
filesed=$filedir/$filebase.sed
#
# Backup and always use original file
#
if test -f $file.bk
then
cp -fp $file.bk $file
else
cp -fp $file $file.bk
fi
case $file in
sql/Makefile.in)
# Use gen_lex_hash.linux instead of gen_lex_hash
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(pstack_libs) \$(openssl_libs) \$(yassl_libs)"
cat > $filesed << EOF
s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \)%\1$lib_DEPENDENCIES %
EOF
;;
extra/Makefile.in)
cat > $filesed << EOF
s,\(extra/comp_err\)\$(EXEEXT),\1.linux,
EOF
;;
libmysql/Makefile.in)
cat > $filesed << EOF
s,libyassl.la,.libs/libyassl.a,
s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
libmysql_r/Makefile.in)
cat > $filesed << EOF
s,libyassl.la,.libs/libyassl.a,
s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
client/Makefile.in)
#
cat > $filesed << EOF
s,libmysqlclient.la,.libs/libmysqlclient.a,
EOF
;;
esac
if `sed -f $filesed $file > $file.nw`;\
then
mv -f $file.nw $file
rm -f $filesed
else
exit 1
fi
# wait for file system changes to complete
sleep 1
done
echo "done"
#
# Make sure the following files are writable.
#
# When the files are retrieved from some source code control systems they are read-only.
#
echo -n "making sure specific build files are writable... "
for file in \
Docs/manual.chm \
Docs/mysql.info \
Docs/INSTALL-BINARY \
INSTALL-SOURCE \
COPYING
do
if test -e $file; then
chmod +w $file
fi
done
echo "done"
;;
esac esac
@ -1818,12 +1711,7 @@ esac
# System characteristics # System characteristics
case $SYSTEM_TYPE in
*netware*) ;;
*)
AC_SYS_RESTARTABLE_SYSCALLS AC_SYS_RESTARTABLE_SYSCALLS
;;
esac
# Build optimized or debug version ? # Build optimized or debug version ?
# First check for gcc and g++ # First check for gcc and g++
@ -1863,17 +1751,6 @@ else
esac esac
fi fi
case $SYSTEM_TYPE in
*netware*)
DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_OPTIMIZE_CC="-DDEBUG"
DEBUG_OPTIMIZE_CXX="-DDEBUG"
OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
;;
esac
# If the user specified CFLAGS, we won't add any optimizations # If the user specified CFLAGS, we won't add any optimizations
if test -n "$SAVE_CFLAGS" if test -n "$SAVE_CFLAGS"
then then
@ -2221,18 +2098,13 @@ MYSQL_TZNAME
# Do the c++ compiler have a bool type # Do the c++ compiler have a bool type
MYSQL_CXX_BOOL MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc # Check some common bugs with gcc 2.8.# on sparc
case $SYSTEM_TYPE in MYSQL_CHECK_LONGLONG_TO_FLOAT
*netware*) ;; if test "$ac_cv_conv_longlong_to_float" != "yes"
*) then
MYSQL_CHECK_LONGLONG_TO_FLOAT AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
if test "$ac_cv_conv_longlong_to_float" != "yes" If you are using gcc 2.8.# you should upgrade to egcs 1.0.3
then or newer and try again])
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float! fi
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
again])
fi
;;
esac
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>]) AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>]) AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
AC_CHECK_TYPES([u_int32_t]) AC_CHECK_TYPES([u_int32_t])
@ -2930,66 +2802,58 @@ readline_h_ln_cmd=""
readline_link="" readline_link=""
want_to_use_readline="no" want_to_use_readline="no"
case $SYSTEM_TYPE in if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
*netware*) then
# For NetWare, do not need readline readline_topdir="cmd-line-utils"
echo "Skipping readline" readline_basedir="libedit"
;; readline_dir="$readline_topdir/$readline_basedir"
*) readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"] readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
compile_libedit=yes
AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
elif test "$with_readline" = "yes"
then
readline_topdir="cmd-line-utils"
readline_basedir="readline"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes
want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else
# Use system readline library
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE
if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
then then
readline_topdir="cmd-line-utils" # Use the new readline interface, but only if the package includes a bundled libreadline
readline_basedir="libedit" # this way we avoid linking commercial source with GPL readline
readline_dir="$readline_topdir/$readline_basedir" readline_link="-lreadline"
readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a" want_to_use_readline="yes"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline" elif [test "$mysql_cv_libedit_interface" = "yes"]
compile_libedit=yes
AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
elif test "$with_readline" = "yes"
then then
readline_topdir="cmd-line-utils" # Use libedit
readline_basedir="readline" readline_link="-ledit"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes
want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else else
# Use system readline library AC_MSG_ERROR([Could not find system readline or libedit libraries
AC_LANG_SAVE Use --with-readline or --with-libedit to use the bundled
AC_LANG_CPLUSPLUS versions of libedit or readline])
MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE
if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
then
# Use the new readline interface, but only if the package includes a bundled libreadline
# this way we avoid linking commercial source with GPL readline
readline_link="-lreadline"
want_to_use_readline="yes"
elif [test "$mysql_cv_libedit_interface" = "yes"]
then
# Use libedit
readline_link="-ledit"
else
AC_MSG_ERROR([Could not find system readline or libedit libraries
Use --with-readline or --with-libedit to use the bundled
versions of libedit or readline])
fi
fi fi
fi
# if there is no readline, but we want to build with readline, we fail # if there is no readline, but we want to build with readline, we fail
if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"] if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
then then
AC_MSG_ERROR([This commercially licensed MySQL source package can't AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.]) the bundled version of libedit instead.])
fi fi
;;
esac
AC_SUBST(readline_dir) AC_SUBST(readline_dir)
AC_SUBST(readline_topdir) AC_SUBST(readline_topdir)
@ -3079,15 +2943,6 @@ AC_SUBST(NON_THREADED_LIBS)
AC_SUBST(STATIC_NSS_FLAGS) AC_SUBST(STATIC_NSS_FLAGS)
AC_SUBST(sql_client_dirs) AC_SUBST(sql_client_dirs)
# If configuring for NetWare, build the netware directory
netware_dir=
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
then
netware_dir="netware"
fi
AC_SUBST(netware_dir)
AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no" if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
then then
AC_DEFINE([THREAD], [1], AC_DEFINE([THREAD], [1],
@ -3145,14 +3000,6 @@ AC_SUBST(CC)
AC_SUBST(GXX) AC_SUBST(GXX)
# Set configuration options for make_binary_distribution # Set configuration options for make_binary_distribution
case $SYSTEM_TYPE in
*netware*)
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
;;
*)
: # no change for other platforms yet
;;
esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS) AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -3225,8 +3072,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
libmysqld/Makefile libmysqld/examples/Makefile dnl libmysqld/Makefile libmysqld/examples/Makefile dnl
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
netware/Makefile sql-bench/Makefile dnl sql-bench/Makefile include/mysql_version.h plugin/Makefile win/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile
cmake/Makefile cmake/Makefile
) )

View File

@ -89,9 +89,6 @@ static struct my_option my_long_options[] =
}; };
#include <help_start.h>
static void usage(my_bool version) static void usage(my_bool version)
{ {
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
@ -107,8 +104,6 @@ static void usage(my_bool version)
printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname); printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),

View File

@ -15,8 +15,6 @@
/* Wait until a program dies */ /* Wait until a program dies */
#ifndef __NETWARE__
#include <my_global.h> #include <my_global.h>
#include <m_string.h> #include <m_string.h>
#include <my_sys.h> #include <my_sys.h>
@ -103,15 +101,3 @@ void usage(void)
my_print_help(my_long_options); my_print_help(my_long_options);
exit(-1); exit(-1);
} }
#else
#include <stdio.h>
main()
{
fprintf(stderr,"This tool has not been ported to NetWare\n");
return 0;
}
#endif /* __NETWARE__ */

View File

@ -102,8 +102,6 @@ static HA_ERRORS ha_errlist[]=
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION, printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION,
@ -122,8 +120,6 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -281,7 +277,7 @@ int main(int argc,char *argv[])
#endif #endif
{ {
/* /*
On some system, like NETWARE, strerror(unknown_error) returns a On some system, like Linux, strerror(unknown_error) returns a
string 'Unknown Error'. To avoid printing it we try to find the string 'Unknown Error'. To avoid printing it we try to find the
error string by asking for an impossible big error message. error string by asking for an impossible big error message.

View File

@ -65,8 +65,6 @@ static struct my_option my_long_options[] =
static void verify_sort(); static void verify_sort();
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
@ -90,8 +88,6 @@ The numeric-dump-file should contain a numeric stack trace from mysqld.\n\
If the numeric-dump-file is not given, the stack trace is read from stdin.\n"); If the numeric-dump-file is not given, the stack trace is read from stdin.\n");
} }
#include <help_end.h>
static void die(const char* fmt, ...) static void die(const char* fmt, ...)
{ {

View File

@ -155,11 +155,8 @@ int main(int argc, char **argv)
else else
{ {
printf ("Host name of %s is %s", ip,hpaddr->h_name); printf ("Host name of %s is %s", ip,hpaddr->h_name);
#ifndef __NETWARE__
/* this information is not available on NetWare */
for (q = hpaddr->h_aliases; *q != 0; q++) for (q = hpaddr->h_aliases; *q != 0; q++)
(void) printf(", %s", *q); (void) printf(", %s", *q);
#endif /* __NETWARE__ */
puts(""); puts("");
} }
} }

View File

@ -34,9 +34,8 @@
#include "openssl/ssl.h" // ASN1_STRING and DH #include "openssl/ssl.h" // ASN1_STRING and DH
// Check if _POSIX_THREADS should be forced // Check if _POSIX_THREADS should be forced
#if !defined(_POSIX_THREADS) && (defined(__NETWARE__) || defined(__hpux)) #if !defined(_POSIX_THREADS) && defined(__hpux)
// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented // HPUX does not define _POSIX_THREADS as it's not _fully_ implemented
// Netware supports pthreads but does not announce it
#define _POSIX_THREADS #define _POSIX_THREADS
#endif #endif

View File

@ -37,7 +37,7 @@
#include <fcntl.h> #include <fcntl.h>
#endif // _WIN32 #endif // _WIN32
#if defined(__sun) || defined(__SCO_VERSION__) || defined(__NETWARE__) #if defined(__sun) || defined(__SCO_VERSION__)
#include <sys/filio.h> #include <sys/filio.h>
#endif #endif

View File

@ -92,67 +92,6 @@ void OS_Seed::GenerateSeed(byte* output, word32 sz)
} }
#elif defined(__NETWARE__)
/* The OS_Seed implementation for Netware */
#include <nks/thread.h>
#include <nks/plat.h>
// Loop on high resulution Read Time Stamp Counter
static void NetwareSeed(byte* output, word32 sz)
{
word32 tscResult;
for (word32 i = 0; i < sz; i += sizeof(tscResult)) {
#if defined(__GNUC__)
asm volatile("rdtsc" : "=A" (tscResult));
#else
#ifdef __MWERKS__
asm {
#else
__asm {
#endif
rdtsc
mov tscResult, eax
}
#endif
memcpy(output, &tscResult, sizeof(tscResult));
output += sizeof(tscResult);
NXThreadYield(); // induce more variance
}
}
OS_Seed::OS_Seed()
{
}
OS_Seed::~OS_Seed()
{
}
void OS_Seed::GenerateSeed(byte* output, word32 sz)
{
/*
Try to use NXSeedRandom as it will generate a strong
seed using the onboard 82802 chip
As it's not always supported, fallback to default
implementation if an error is returned
*/
if (NXSeedRandom(sz, output) != 0)
{
NetwareSeed(output, sz);
}
}
#else #else
/* The default OS_Seed implementation */ /* The default OS_Seed implementation */

View File

@ -32,8 +32,7 @@
#endif /* _WIN32 */ #endif /* _WIN32 */
#if !defined(_SOCKLEN_T) && \ #if !defined(_SOCKLEN_T) && (defined(_WIN32) || defined(__APPLE__))
(defined(_WIN32) || defined(__NETWARE__) || defined(__APPLE__))
typedef int socklen_t; typedef int socklen_t;
#endif #endif
@ -42,18 +41,14 @@
#if defined(__hpux) #if defined(__hpux)
// HPUX uses int* for third parameter to accept // HPUX uses int* for third parameter to accept
typedef int* ACCEPT_THIRD_T; typedef int* ACCEPT_THIRD_T;
#elif defined(__NETWARE__)
// NetWare uses size_t* for third parameter to accept
typedef size_t* ACCEPT_THIRD_T;
#else #else
typedef socklen_t* ACCEPT_THIRD_T; typedef socklen_t* ACCEPT_THIRD_T;
#endif #endif
// Check if _POSIX_THREADS should be forced // Check if _POSIX_THREADS should be forced
#if !defined(_POSIX_THREADS) && (defined(__NETWARE__) || defined(__hpux)) #if !defined(_POSIX_THREADS) && defined(__hpux)
// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented // HPUX does not define _POSIX_THREADS as it's not _fully_ implemented
// Netware supports pthreads but does not announce it
#define _POSIX_THREADS #define _POSIX_THREADS
#endif #endif

View File

@ -33,10 +33,10 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \ m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h $(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \ noinst_HEADERS = config-win.h lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h password.h \ heap.h my_bitmap.h my_uctype.h password.h \
myisam.h myisampack.h myisammrg.h ft_global.h\ myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.h \ mysys_err.h my_base.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \

View File

@ -1,161 +0,0 @@
/* Copyright (C) 2000 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 */
/* Header for NetWare compatible with MySQL */
#ifndef _config_netware_h
#define _config_netware_h
#define __event_h__
#define _EVENT_H_
/*
These two #define(s) are needed as both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
/* required headers */
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <screen.h>
#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
#include <termios.h>
#undef _EVENT_H_
/*
This #undef exists here because both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* required adjustments */
#undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT
#undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H
#undef HAVE_MMAP
#undef HAVE_RINT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1
/* changes made to make use of LibC-June-2004 for building purpose */
#undef HAVE_POSIX_SIGNALS
#undef HAVE_PTHREAD_ATTR_SETSCOPE
#undef HAVE_ALLOC_A
#undef HAVE_FINITE
#undef HAVE_GETPWNAM
#undef HAVE_GETPWUID
#undef HAVE_READLINK
#undef HAVE_STPCPY
/* changes end */
/* Changes made to make use of LibC-June-2005 for building purpose */
#undef HAVE_GETPASS
#undef HAVE_GETRLIMIT
#undef HAVE_GETRUSAGE
#undef HAVE_INITGROUPS
/* Changes end - LibC-June-2005 */
/* no libc crypt() function */
#ifdef HAVE_OPENSSL
#define HAVE_CRYPT 1
#else
#undef HAVE_CRYPT
#endif /* HAVE_OPENSSL */
/* Netware has an ancient zlib */
#undef HAVE_COMPRESS
#define HAVE_COMPRESS
#undef HAVE_ARCHIVE_DB
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
/* no case sensitivity */
#define FN_NO_CASE_SENSE 1
/* the thread alarm is not used */
#define DONT_USE_THR_ALARM 1
/* signals do not interrupt sockets */
#define SIGNALS_DONT_BREAK_READ 1
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
/* On NetWare, stack grows towards lower address */
#define STACK_DIRECTION -1
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
#define NW_THD_STACKSIZE 65536
/* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "sys:/"
#define SHAREDIR "share/"
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
#define MYSQL_DATADIR "data/"
/* 64-bit file system calls */
#define SIZEOF_OFF_T 8
#define off_t off64_t
#define chsize chsize64
#define ftruncate ftruncate64
#define lseek lseek64
#define pread pread64
#define pwrite pwrite64
#define tell tell64
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
/* Some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
/* extra protection against CPU Hogs on NetWare */
#define NETWARE_YIELD pthread_yield()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */

View File

@ -1,26 +0,0 @@
#ifndef HELP_END_INCLUDED
#define HELP_END_INCLUDED
/* Copyright (C) 2004-2005 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __NETWARE__
#undef printf
#undef puts
#undef fputs
#undef fputc
#undef putchar
#endif
#endif /* HELP_END_INCLUDED */

View File

@ -1,28 +0,0 @@
#ifndef HELP_START_INCLUDED
#define HELP_START_INCLUDED
/* Copyright (C) 2004-2005 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#define puts(s) consoleprintf("%s\n",s)
#define fputs(s,f) puts(s)
#define fputc(s,f) consoleprintf("%c", s)
#define putchar(s) consoleprintf("%c", s)
#endif
#endif /* HELP_START_INCLUDED */

View File

@ -82,20 +82,7 @@
#define CPP_UNNAMED_NS_END } #define CPP_UNNAMED_NS_END }
#endif #endif
#if defined(_WIN32)
#include <my_config.h> #include <my_config.h>
#elif defined(__NETWARE__)
#include <my_config.h>
#include <config-netware.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#else
#include <my_config.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#endif /* _WIN32... */
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#define HAVE_PSI_INTERFACE #define HAVE_PSI_INTERFACE
@ -108,12 +95,6 @@
#define IF_WIN(A,B) B #define IF_WIN(A,B) B
#endif #endif
#ifdef __NETWARE__
#define IF_NETWARE(A,B) A
#else
#define IF_NETWARE(A,B) B
#endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
#define IF_DBUG(A,B) A #define IF_DBUG(A,B) A
#else #else
@ -143,12 +124,6 @@
#define HAVE_EXTERNAL_CLIENT #define HAVE_EXTERNAL_CLIENT
#endif #endif
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
#define NETWARE_SET_SCREEN_MODE(A)
#endif
#if defined (_WIN32) #if defined (_WIN32)
/* /*
off_t is 32 bit long. We do not use C runtime functions off_t is 32 bit long. We do not use C runtime functions
@ -1677,25 +1652,12 @@ do { doubleget_union _tmp; \
#endif #endif
#ifndef __NETWARE__
/* /*
* Include standard definitions of operator new and delete. * Include standard definitions of operator new and delete.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <new> #include <new>
#endif #endif
#else
/*
* Define placement versions of operator new and operator delete since
* we don't have <new> when building for Netware.
*/
#ifdef __cplusplus
inline void *operator new(size_t, void *ptr) { return ptr; }
inline void *operator new[](size_t, void *ptr) { return ptr; }
inline void operator delete(void*, void*) { /* Do nothing */ }
inline void operator delete[](void*, void*) { /* Do nothing */ }
#endif
#endif
/* Length of decimal number represented by INT32. */ /* Length of decimal number represented by INT32. */
#define MY_INT32_NUM_DECIMAL_DIGITS 11 #define MY_INT32_NUM_DECIMAL_DIGITS 11

View File

@ -46,7 +46,7 @@ C_MODE_START
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__NETWARE__) #if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES)
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/ip.h> #include <netinet/ip.h>

View File

@ -195,11 +195,6 @@ int pthread_cancel(pthread_t thread);
#include <synch.h> #include <synch.h>
#endif #endif
#ifdef __NETWARE__
void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A)
#endif
#define pthread_key(T,V) pthread_key_t V #define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V)) #define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V)) #define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
@ -356,7 +351,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread #undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); } #define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ #else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL #define HAVE_PTHREAD_KILL
#endif #endif
@ -461,10 +456,6 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
/* safe_mutex adds checking to mutex for easier debugging */ /* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#define SAFE_MUTEX_DETECT_DESTROY
#endif
typedef struct st_safe_mutex_t typedef struct st_safe_mutex_t
{ {
pthread_mutex_t global,mutex; pthread_mutex_t global,mutex;

View File

@ -32,9 +32,7 @@
#define HAVE_STACKTRACE 1 #define HAVE_STACKTRACE 1
#endif #endif
#if !defined(__NETWARE__)
#define HAVE_WRITE_CORE #define HAVE_WRITE_CORE
#endif
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \ #if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \ HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \

View File

@ -913,10 +913,7 @@ extern int my_getncpus();
#define MAP_FAILED ((void *)-1) #define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000 #define MS_SYNC 0x0000
#ifndef __NETWARE__
#define HAVE_MMAP #define HAVE_MMAP
#endif
void *my_mmap(void *, size_t, int, int, int, my_off_t); void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t); int my_munmap(void *, size_t);
#endif #endif
@ -981,10 +978,6 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
char* my_cgets(char *string, size_t clen, size_t* plen); char* my_cgets(char *string, size_t clen, size_t* plen);
#endif #endif
#ifdef __NETWARE__
void netware_reg_user(const char *ip, const char *user,
const char *application);
#endif
#include <mysql/psi/psi.h> #include <mysql/psi/psi.h>

View File

@ -79,10 +79,6 @@ extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */ #define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */ #define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#ifdef __NETWARE__
#pragma pack(push, 8) /* 8 byte alignment */
#endif
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG)
@ -746,10 +742,6 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
(*(mysql)->methods->advanced_command)(mysql, command, 0, \ (*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt) 0, arg, length, 1, stmt)
#ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -36,7 +36,7 @@
#include <pwd.h> #include <pwd.h>
#endif /* HAVE_PWD_H */ #endif /* HAVE_PWD_H */
#else /* ! HAVE_GETPASS */ #else /* ! HAVE_GETPASS */
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef HAVE_TERMIOS_H /* For tty-password */ #ifdef HAVE_TERMIOS_H /* For tty-password */
#include <termios.h> #include <termios.h>
@ -55,9 +55,7 @@
#include <asm/termiobits.h> #include <asm/termiobits.h>
#endif #endif
#else #else
#ifndef __NETWARE__
#include <conio.h> #include <conio.h>
#endif /* __NETWARE__ */
#endif /* __WIN__ */ #endif /* __WIN__ */
#endif /* HAVE_GETPASS */ #endif /* HAVE_GETPASS */
@ -65,16 +63,8 @@
#define getpass(A) getpassphrase(A) #define getpass(A) getpassphrase(A)
#endif #endif
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__)
/* were just going to fake it here and get input from the keyboard */ /* were just going to fake it here and get input from the keyboard */
#ifdef __NETWARE__
#undef _getch
#undef _cputs
#define _getch getcharacter
#define _cputs(A) putstring(A)
#endif
char *get_tty_password(const char *opt_message) char *get_tty_password(const char *opt_message)
{ {
char to[80]; char to[80];

View File

@ -165,7 +165,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_unix_port = env; mysql_unix_port = env;
} }
mysql_debug(NullS); mysql_debug(NullS);
#if defined(SIGPIPE) && !defined(__WIN__) && !defined(__NETWARE__) #if defined(SIGPIPE) && !defined(__WIN__)
(void) signal(SIGPIPE, SIG_IGN); (void) signal(SIGPIPE, SIG_IGN);
#endif #endif
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
@ -479,15 +479,7 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void); char* getlogin(void);
#endif #endif
#if defined(__NETWARE__) #if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__)
/* Default to value of USER on NetWare, if unset use "UNKNOWN_USER" */
void read_user_name(char *name)
{
char *str=getenv("USER");
strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH);
}
#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__)
void read_user_name(char *name) void read_user_name(char *name)
{ {

View File

@ -157,27 +157,6 @@ if DARWIN_MWCC
mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects) mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
else else
-rm -f libmysqld.a -rm -f libmysqld.a
if test "$(host_os)" = "netware" ; \
then \
$(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
else \
current_dir=`pwd`; \
rm -rf tmp; mkdir tmp; \
(for arc in $(INC_LIB) ./libmysqld_int.a; do \
arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
mkdir $$artmp; cd $$artmp > /dev/null; \
$(AR) x ../../$$arc; \
cd $$current_dir > /dev/null; \
ls $$artmp/* | grep -v SYMDEF; \
continue 2; fi; done; \
done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
$(AR) r libmysqld.a $(storageobjects); \
$(RANLIB) libmysqld.a ; \
rm -rf tmp; \
fi
endif endif
## XXX: any time the client interface changes, we'll need to bump ## XXX: any time the client interface changes, we'll need to bump

View File

@ -141,7 +141,6 @@ sub mtr_exe_maybe_exists (@) {
my @path= @_; my @path= @_;
map {$_.= ".exe"} @path if $::glob_win32; map {$_.= ".exe"} @path if $::glob_win32;
map {$_.= ".nlm"} @path if $::glob_netware;
foreach my $path ( @path ) foreach my $path ( @path )
{ {
if($::glob_win32) if($::glob_win32)

View File

@ -76,7 +76,6 @@ $| = 1; # Automatically flush STDOUT
our $glob_win32_perl= ($^O eq "MSWin32"); # ActiveState Win32 Perl our $glob_win32_perl= ($^O eq "MSWin32"); # ActiveState Win32 Perl
our $glob_cygwin_perl= ($^O eq "cygwin"); # Cygwin Perl our $glob_cygwin_perl= ($^O eq "cygwin"); # Cygwin Perl
our $glob_win32= ($glob_win32_perl or $glob_cygwin_perl); our $glob_win32= ($glob_win32_perl or $glob_cygwin_perl);
our $glob_netware= ($^O eq "NetWare"); # NetWare
require "lib/v1/mtr_cases.pl"; require "lib/v1/mtr_cases.pl";
require "lib/v1/mtr_im.pl"; require "lib/v1/mtr_im.pl";
@ -3125,11 +3124,8 @@ sub install_db ($$) {
$path_vardir_trace, $type); $path_vardir_trace, $type);
} }
if ( ! $glob_netware ) mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
{ mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
}
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g., # If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
# configure --disable-grant-options), mysqld will not recognize the # configure --disable-grant-options), mysqld will not recognize the

View File

@ -77,7 +77,6 @@ SELECT @@global.innodb_fast_shutdown;
SET @@global.innodb_fast_shutdown = 1; SET @@global.innodb_fast_shutdown = 1;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;
## A value of 2 is used to just flush logs and then shutdown cold. ## A value of 2 is used to just flush logs and then shutdown cold.
## Not supported on Netware
SET @@global.innodb_fast_shutdown = 2; SET @@global.innodb_fast_shutdown = 2;
SELECT @@global.innodb_fast_shutdown; SELECT @@global.innodb_fast_shutdown;

View File

@ -120,7 +120,7 @@ SELECT @@global.ndb_log_update_as_write;
#SELECT @@global.ndb_log_update_as_write; #SELECT @@global.ndb_log_update_as_write;
#SET @@global.ndb_log_update_as_write = 1; #SET @@global.ndb_log_update_as_write = 1;
#SELECT @@global.ndb_log_update_as_write; #SELECT @@global.ndb_log_update_as_write;
## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware ## a value of 2 is used to just flush logs and then shutdown cold.
#SET @@global.ndb_log_update_as_write = 2; #SET @@global.ndb_log_update_as_write = 2;
#SELECT @@global.ndb_log_update_as_write; #SELECT @@global.ndb_log_update_as_write;

View File

@ -120,7 +120,7 @@ SELECT @@global.ndb_log_updated_only;
#SELECT @@global.ndb_log_updated_only; #SELECT @@global.ndb_log_updated_only;
#SET @@global.ndb_log_updated_only = 1; #SET @@global.ndb_log_updated_only = 1;
#SELECT @@global.ndb_log_updated_only; #SELECT @@global.ndb_log_updated_only;
## a value of 2 is used to just flush logs and then shutdown cold. Not supported on Netware ## a value of 2 is used to just flush logs and then shutdown cold.
#SET @@global.ndb_log_updated_only = 2; #SET @@global.ndb_log_updated_only = 2;
#SELECT @@global.ndb_log_updated_only; #SELECT @@global.ndb_log_updated_only;

View File

@ -51,7 +51,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
my_net.c my_port.c my_sleep.c \ my_net.c my_port.c my_sleep.c \
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \ charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \ my_gethostbyname.c rijndael.c my_aes.c sha1.c \
my_handler.c my_netware.c my_largepage.c \ my_handler.c my_largepage.c \
my_memmem.c stacktrace.c \ my_memmem.c stacktrace.c \
my_windac.c my_access.c base64.c my_libwrap.c \ my_windac.c my_access.c base64.c my_libwrap.c \
my_rdtsc.c my_rdtsc.c

View File

@ -118,7 +118,6 @@ static int search_default_file_with_ext(Process_option_func func,
- Windows: GetWindowsDirectory() - Windows: GetWindowsDirectory()
- Windows: C:/ - Windows: C:/
- Windows: Directory above where the executable is located - Windows: Directory above where the executable is located
- Netware: sys:/etc/
- Unix: /etc/ - Unix: /etc/
- Unix: /etc/mysql/ - Unix: /etc/mysql/
- Unix: --sysconfdir=<path> (compile-time option) - Unix: --sysconfdir=<path> (compile-time option)
@ -708,7 +707,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
strmov(name,config_file); strmov(name,config_file);
} }
fn_format(name,name,"","",4); fn_format(name,name,"","",4);
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
{ {
MY_STAT stat_info; MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(0))) if (!my_stat(name,&stat_info,MYF(0)))
@ -954,7 +953,6 @@ static char *remove_end_comment(char *ptr)
return ptr; return ptr;
} }
#include <help_start.h>
void my_print_default_files(const char *conf_file) void my_print_default_files(const char *conf_file)
{ {
@ -1034,8 +1032,6 @@ void print_defaults(const char *conf_file, const char **groups)
--defaults-extra-file=# Read this file after the global files are read."); --defaults-extra-file=# Read this file after the global files are read.");
} }
#include <help_end.h>
static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs)
{ {
@ -1150,10 +1146,6 @@ static const char **init_default_directories(MEM_ROOT *alloc)
errors += add_directory(alloc, fname_buffer, dirs); errors += add_directory(alloc, fname_buffer, dirs);
} }
#elif defined(__NETWARE__)
errors += add_directory(alloc, "sys:/etc/", dirs);
#else #else
errors += add_directory(alloc, "/etc/", dirs); errors += add_directory(alloc, "/etc/", dirs);
@ -1172,7 +1164,7 @@ static const char **init_default_directories(MEM_ROOT *alloc)
/* Placeholder for --defaults-extra-file=<path> */ /* Placeholder for --defaults-extra-file=<path> */
errors += add_directory(alloc, "", dirs); errors += add_directory(alloc, "", dirs);
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
errors += add_directory(alloc, "~/", dirs); errors += add_directory(alloc, "~/", dirs);
#endif #endif

View File

@ -78,9 +78,6 @@ char * my_path(char * to, const char *progname,
#define F_OK 0 #define F_OK 0
#define PATH_SEP ';' #define PATH_SEP ';'
#define PROGRAM_EXTENSION ".exe" #define PROGRAM_EXTENSION ".exe"
#elif defined(__NETWARE__)
#define PATH_SEP ';'
#define PROGRAM_EXTENSION ".nlm"
#else #else
#define PATH_SEP ':' #define PATH_SEP ':'
#endif #endif

View File

@ -16,7 +16,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include <m_string.h> #include <m_string.h>
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__)
#define DELIM ';' #define DELIM ';'
#else #else
#define DELIM ':' #define DELIM ':'
@ -36,7 +36,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{ {
/* Get default temporary directory */ /* Get default temporary directory */
pathlist=getenv("TMPDIR"); /* Use this if possible */ pathlist=getenv("TMPDIR"); /* Use this if possible */
#if defined( __WIN__) || defined(__NETWARE__) #if defined(__WIN__)
if (!pathlist) if (!pathlist)
pathlist=getenv("TEMP"); pathlist=getenv("TEMP");
if (!pathlist) if (!pathlist)

View File

@ -109,7 +109,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
(*free)(res); (*free)(res);
file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags); file=my_create(to, 0, mode | O_EXCL | O_NOFOLLOW, MyFlags);
} }
#elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__) #elif defined(HAVE_MKSTEMP)
{ {
char prefix_buff[30]; char prefix_buff[30];
uint pfx_len; uint pfx_len;
@ -143,9 +143,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
} }
#elif defined(HAVE_TEMPNAM) #elif defined(HAVE_TEMPNAM)
{ {
#if !defined(__NETWARE__)
extern char **environ; extern char **environ;
#endif
char *res,**old_env,*temp_env[1]; char *res,**old_env,*temp_env[1];
if (dir && !dir[0]) if (dir && !dir[0])
@ -154,14 +152,14 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
to[1]= 0; to[1]= 0;
dir=to; dir=to;
} }
#if !defined(__NETWARE__)
old_env= (char**) environ; old_env= (char**) environ;
if (dir) if (dir)
{ /* Don't use TMPDIR if dir is given */ { /* Don't use TMPDIR if dir is given */
environ=(const char**) temp_env; environ=(const char**) temp_env;
temp_env[0]=0; temp_env[0]=0;
} }
#endif
if ((res=tempnam((char*) dir, (char*) prefix))) if ((res=tempnam((char*) dir, (char*) prefix)))
{ {
strmake(to,res,FN_REFLEN-1); strmake(to,res,FN_REFLEN-1);
@ -176,9 +174,8 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
{ {
DBUG_PRINT("error",("Got error: %d from tempnam",errno)); DBUG_PRINT("error",("Got error: %d from tempnam",errno));
} }
#if !defined(__NETWARE__)
environ=(const char**) old_env; environ=(const char**) old_env;
#endif
} }
#else #else
#error No implementation found for create_temp_file #error No implementation found for create_temp_file

View File

@ -15,14 +15,14 @@
#include "my_global.h" #include "my_global.h"
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__NETWARE__) #if !defined(_MSC_VER) && !defined(__BORLANDC__)
#include "mysys_priv.h" #include "mysys_priv.h"
#include <sys/times.h> #include <sys/times.h>
#endif #endif
long my_clock(void) long my_clock(void)
{ {
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
struct tms tmsbuf; struct tms tmsbuf;
(void) times(&tmsbuf); (void) times(&tmsbuf);
return (tmsbuf.tms_utime + tmsbuf.tms_stime); return (tmsbuf.tms_utime + tmsbuf.tms_stime);

View File

@ -103,7 +103,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
DBUG_RETURN(0); /* File copyed but not stat */ DBUG_RETURN(0); /* File copyed but not stat */
res= chmod(to, stat_buff.st_mode & 07777); /* Copy modes */ res= chmod(to, stat_buff.st_mode & 07777); /* Copy modes */
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
res= chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */ res= chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */
#endif #endif
#if !defined(VMS) && !defined(__ZTC__) #if !defined(VMS) && !defined(__ZTC__)

View File

@ -1147,8 +1147,6 @@ static uint print_name(const struct my_option *optp)
Print help for all options and variables. Print help for all options and variables.
*/ */
#include <help_start.h>
void my_print_help(const struct my_option *options) void my_print_help(const struct my_option *options)
{ {
uint col, name_space= 22, comment_space= 57; uint col, name_space= 22, comment_space= 57;
@ -1330,5 +1328,3 @@ void my_print_variables(const struct my_option *options)
} }
} }
} }
#include <help_end.h>

View File

@ -25,10 +25,6 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include "my_static.h" #include "my_static.h"
#ifdef __NETWARE__
#include <nks/time.h>
#endif
ulonglong my_getsystime() ulonglong my_getsystime()
{ {
#ifdef HAVE_CLOCK_GETTIME #ifdef HAVE_CLOCK_GETTIME
@ -45,10 +41,6 @@ ulonglong my_getsystime()
query_performance_frequency) + query_performance_offset); query_performance_frequency) + query_performance_offset);
} }
return 0; return 0;
#elif defined(__NETWARE__)
NXTime_t tm;
NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
return (ulonglong)tm/100;
#else #else
/* TODO: check for other possibilities for hi-res timestamping */ /* TODO: check for other possibilities for hi-res timestamping */
struct timeval tv; struct timeval tv;

View File

@ -36,11 +36,6 @@ static my_bool win32_init_tcp_ip();
#else #else
#define my_win_init() #define my_win_init()
#endif #endif
#ifdef __NETWARE__
static void netware_init();
#else
#define netware_init()
#endif
my_bool my_init_done= 0; my_bool my_init_done= 0;
/** True if @c my_basic_init() has been called. */ /** True if @c my_basic_init() has been called. */
@ -109,7 +104,6 @@ my_bool my_basic_init(void)
#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) #if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX)
fastmutex_global_init(); /* Must be called early */ fastmutex_global_init(); /* Must be called early */
#endif #endif
netware_init();
#ifdef THREAD #ifdef THREAD
#if defined(HAVE_PTHREAD_INIT) #if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */ pthread_init(); /* Must be called before DBUG_ENTER */
@ -150,7 +144,7 @@ my_bool my_init(void)
#ifdef THREAD #ifdef THREAD
if (my_thread_global_init()) if (my_thread_global_init())
return 1; return 1;
#if !defined( __WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
sigfillset(&my_signals); /* signals blocked by mf_brkhant */ sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif #endif
#endif /* THREAD */ #endif /* THREAD */
@ -239,9 +233,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals, rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals,
rus.ru_nvcsw, rus.ru_nivcsw); rus.ru_nvcsw, rus.ru_nivcsw);
#endif #endif
#if defined(__NETWARE__) && !defined(__WIN__)
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
#endif
#if defined(__WIN__) && defined(_MSC_VER) #if defined(__WIN__) && defined(_MSC_VER)
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
@ -524,60 +515,6 @@ static my_bool win32_init_tcp_ip()
} }
#endif /* __WIN__ */ #endif /* __WIN__ */
#ifdef __NETWARE__
/*
Basic initialisation for netware
*/
static void netware_init()
{
char cwd[PATH_MAX], *name;
DBUG_ENTER("netware_init");
/* init only if we are not a client library */
if (my_progname)
{
#if SUPPORTED_BY_LIBC /* Removed until supported in Libc */
struct termios tp;
/* Disable control characters */
tcgetattr(STDIN_FILENO, &tp);
tp.c_cc[VINTR] = _POSIX_VDISABLE;
tp.c_cc[VEOF] = _POSIX_VDISABLE;
tp.c_cc[VSUSP] = _POSIX_VDISABLE;
tcsetattr(STDIN_FILENO, TCSANOW, &tp);
#endif /* SUPPORTED_BY_LIBC */
/* With stdout redirection */
if (!isatty(STDOUT_FILENO))
{
setscreenmode(SCR_AUTOCLOSE_ON_EXIT); /* auto close the screen */
}
else
{
setscreenmode(SCR_NO_MODE); /* keep the screen up */
}
/* Parse program name and change to base format */
name= (char*) my_progname;
for (; *name; name++)
{
if (*name == '\\')
{
*name = '/';
}
else
{
*name = tolower(*name);
}
}
}
DBUG_VOID_RETURN;
}
#endif /* __NETWARE__ */
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
#if !defined(HAVE_PREAD) && !defined(_WIN32) #if !defined(HAVE_PREAD) && !defined(_WIN32)

View File

@ -22,9 +22,6 @@
#undef NO_ALARM_LOOP #undef NO_ALARM_LOOP
#endif #endif
#include <my_alarm.h> #include <my_alarm.h>
#ifdef __NETWARE__
#include <nks/fsio.h>
#endif
#ifdef _WIN32 #ifdef _WIN32
#define WIN_LOCK_INFINITE -1 #define WIN_LOCK_INFINITE -1
@ -145,9 +142,6 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
int value; int value;
ALARM_VARIABLES; ALARM_VARIABLES;
#endif #endif
#ifdef __NETWARE__
int nxErrno;
#endif
DBUG_ENTER("my_lock"); DBUG_ENTER("my_lock");
DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d", DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
@ -158,47 +152,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
if (my_disable_locking) if (my_disable_locking)
DBUG_RETURN(0); DBUG_RETURN(0);
#if defined(__NETWARE__) #if defined(_WIN32)
{
NXSOffset_t nxLength = length;
unsigned long nxLockFlags = 0;
if (length == F_TO_EOF)
{
/* EOF is interpreted as a very large length. */
nxLength = 0x7FFFFFFFFFFFFFFF;
}
if (locktype == F_UNLCK)
{
/* The lock flags are currently ignored by NKS. */
if (!(nxErrno= NXFileRangeUnlock(fd, 0L, start, nxLength)))
DBUG_RETURN(0);
}
else
{
if (locktype == F_RDLCK)
{
/* A read lock is mapped to a shared lock. */
nxLockFlags = NX_RANGE_LOCK_SHARED;
}
else
{
/* A write lock is mapped to an exclusive lock. */
nxLockFlags = NX_RANGE_LOCK_EXCL;
}
if (MyFlags & MY_DONT_WAIT)
{
/* Don't block on the lock. */
nxLockFlags |= NX_RANGE_LOCK_TRYLOCK;
}
if (!(nxErrno= NXFileRangeLock(fd, nxLockFlags, start, nxLength)))
DBUG_RETURN(0);
}
}
#elif defined(_WIN32)
{ {
int timeout_sec; int timeout_sec;
if (MyFlags & MY_DONT_WAIT) if (MyFlags & MY_DONT_WAIT)
@ -257,12 +211,9 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#endif /* HAVE_FCNTL */ #endif /* HAVE_FCNTL */
#endif /* HAVE_LOCKING */ #endif /* HAVE_LOCKING */
#ifdef __NETWARE__ /* We got an error. We don't want EACCES errors */
my_errno = nxErrno;
#else
/* We got an error. We don't want EACCES errors */
my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1; my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1;
#endif
if (MyFlags & MY_WME) if (MyFlags & MY_WME)
{ {
if (locktype == F_UNLCK) if (locktype == F_UNLCK)

View File

@ -22,11 +22,7 @@ void my_message_stderr(uint error __attribute__((unused)),
DBUG_PRINT("enter",("message: %s",str)); DBUG_PRINT("enter",("message: %s",str));
(void) fflush(stdout); (void) fflush(stdout);
if (MyFlags & ME_BELL) if (MyFlags & ME_BELL)
#ifdef __NETWARE__ (void) fputc('\007', stderr);
ringbell(); /* Bell */
#else
(void) fputc('\007',stderr); /* Bell */
#endif /* __NETWARE__ */
if (my_progname) if (my_progname)
{ {
(void)fputs(my_progname,stderr); (void)fputs(": ",stderr); (void)fputs(my_progname,stderr); (void)fputs(": ",stderr);

View File

@ -1,150 +0,0 @@
/* Copyright (C) 2003 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 */
/*
Functions specific to netware
*/
#include <mysys_priv.h>
#ifdef __NETWARE__
#include <string.h>
#include <library.h>
/*
PMUserLicenseRequest is an API exported by the polimgr.nlm
(loaded by the NetWare OS when it comes up) for use by other
NLM-based NetWare products/services.
PMUserLicenseRequest provides a couple of functions:
1) it will optionally request a User license or ensure that
one already exists for the specified User in userInfo
2) it utilizes the NetWare usage metering service to
record usage information about your product/service.
*/
long PMMeteredUsageRequest
(
/*
NDS distinguished name or IP address or ??. asciiz string, e.g.
".CN=Admin.O=this.T=MYTREE."
*/
char *userInfo,
long infoType, /* see defined values */
/*
string used to identify the calling service, used to index the
metered info e.g. "iPrint"
*/
char *serviceID,
char tranAddrType, /* type of address that follows */
char *tranAddr, /* ptr to a 10-byte array */
long flags, /* see defined values */
/* NLS error code, if any. NULL input is okay */
long *licRequestErrCode,
/* meter service error code, if any. NULL input is okay */
long *storeMeterInfoErrCode,
/*
error code from NLSMeter if
storeMeterInfoErrCode == PM_LICREQ_NLSMETERERROR.
NULL input is okay
*/
long *NLSMeterErrCode
);
typedef long(*PMUR)(const char*, long, const char*, char,
const char*, long, long*, long*, long*);
/* infoType */
/* indicates that the info in the userInfo param is an NDS user */
#define PM_USERINFO_TYPE_NDS 1
/* indicates that the info in the userInfo param is NOT an NDS user */
#define PM_USERINFO_TYPE_ADDRESS 2
/* Flags */
/*
Tells the service that it should not check to see if the NDS user
contained in the userInfo param has a NetWare User License - just
record metering information; this is ignored if infoType !=
PM_USERINFO_TYPE_NDS
*/
#define PM_FLAGS_METER_ONLY 0x0000001
/*
Indicates that the values in the userInfo and serviceID parameters
are unicode strings, so that the metering service bypasses
converting these to unicode (again)
*/
#define PM_LICREQ_ALREADY_UNICODE 0x0000002
/*
Useful only if infoType is PM_USERINFO_TYPE_NDS - indicates a "no
stop" policy of the calling service
*/
#define PM_LICREQ_ALWAYS_METER 0x0000004
/*
net Address Types - system-defined types of net addresses that can
be used in the tranAddrType field
*/
#define NLS_TRAN_TYPE_IPX 0x00000001 /* An IPX address */
#define NLS_TRAN_TYPE_IP 0x00000008 /* An IP address */
#define NLS_ADDR_TYPE_MAC 0x000000F1 /* a MAC address */
/*
Net Address Sizes - lengths that correspond to the tranAddrType
field (just fyi)
*/
#define NLS_IPX_ADDR_SIZE 10 /* the size of an IPX address */
#define NLS_IP_ADDR_SIZE 4 /* the size of an IP address */
#define NLS_MAC_ADDR_SIZE 6 /* the size of a MAC address */
void netware_reg_user(const char *ip, const char *user,
const char *application)
{
PMUR usage_request;
long licRequestErrCode = 0;
long storeMeterInfoErrCode = 0;
long nlsMeterErrCode = 0;
/* import the symbol */
usage_request= ((PMUR)ImportPublicObject(getnlmhandle(),
"PMMeteredUsageRequest"));
if (usage_request != NULL)
{
unsigned long iaddr;
char addr[NLS_IPX_ADDR_SIZE];
/* create address */
iaddr = htonl(inet_addr(ip));
bzero(addr, NLS_IPX_ADDR_SIZE);
memcpy(addr, &iaddr, NLS_IP_ADDR_SIZE);
/* call to NLS */
usage_request(user,
PM_USERINFO_TYPE_ADDRESS,
application,
NLS_TRAN_TYPE_IP,
addr,
PM_FLAGS_METER_ONLY,
&licRequestErrCode,
&storeMeterInfoErrCode,
&nlsMeterErrCode);
/* release symbol */
UnImportPublicObject(getnlmhandle(), "PMMeteredUsageRequest");
}
}
#endif /* __NETWARE__ */

View File

@ -45,34 +45,6 @@ void *my_pthread_getspecific_imp(pthread_key_t key)
} }
#endif #endif
#ifdef __NETWARE__
/*
Don't kill the LibC Reaper thread or the main thread
*/
#include <nks/thread.h>
#undef pthread_exit
void my_pthread_exit(void *status)
{
NXThreadId_t tid;
NXContext_t ctx;
char name[NX_MAX_OBJECT_NAME_LEN+1] = "";
tid= NXThreadGetId();
if (tid == NX_INVALID_THREAD_ID || !tid)
return;
if (NXThreadGetContext(tid, &ctx) ||
NXContextGetName(ctx, name, sizeof(name)-1))
return;
/*
"MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
with a debug build of LibC the reaper can have different names
*/
if (!strindex(name, "\'s"))
pthread_exit(status);
}
#endif
/* /*
Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7 Some functions for RTS threads, AIX, Siemens Unix and UnixWare 7
(and DEC OSF/1 3.2 too) (and DEC OSF/1 3.2 too)

View File

@ -86,10 +86,6 @@
#include <sys/times.h> /* for times */ #include <sys/times.h> /* for times */
#endif #endif
#if defined(__NETWARE__)
#include <nks/time.h> /* for NXGetTime */
#endif
#if defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) #if defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
#include <ia64intrin.h> /* for __GetReg */ #include <ia64intrin.h> /* for __GetReg */
#endif #endif
@ -265,12 +261,6 @@ ulonglong my_timer_nanoseconds(void)
clock_gettime(CLOCK_REALTIME, &tp); clock_gettime(CLOCK_REALTIME, &tp);
return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec;
} }
#elif defined(__NETWARE__)
{
NXTime_t tm;
NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
return (ulonglong) tm;
}
#elif defined(__APPLE__) && defined(__MACH__) #elif defined(__APPLE__) && defined(__MACH__)
{ {
ulonglong tm; ulonglong tm;
@ -322,12 +312,6 @@ ulonglong my_timer_microseconds(void)
QueryPerformanceCounter(&t_cnt); QueryPerformanceCounter(&t_cnt);
return (ulonglong) t_cnt.QuadPart; return (ulonglong) t_cnt.QuadPart;
} }
#elif defined(__NETWARE__)
{
NXTime_t tm;
NXGetTime(NX_SINCE_1970, NX_USECONDS, &tm);
return (ulonglong) tm;
}
#else #else
return 0; return 0;
#endif #endif
@ -354,12 +338,6 @@ ulonglong my_timer_milliseconds(void)
GetSystemTimeAsFileTime( &ft ); GetSystemTimeAsFileTime( &ft );
return ((ulonglong)ft.dwLowDateTime + return ((ulonglong)ft.dwLowDateTime +
(((ulonglong)ft.dwHighDateTime) << 32))/10000; (((ulonglong)ft.dwHighDateTime) << 32))/10000;
#elif defined(__NETWARE__)
{
NXTime_t tm;
NXGetTime(NX_SINCE_1970, NX_MSECONDS, &tm);
return (ulonglong)tm;
}
#else #else
return 0; return 0;
#endif #endif
@ -378,12 +356,6 @@ ulonglong my_timer_ticks(void)
struct tms times_buf; struct tms times_buf;
return (ulonglong) times(&times_buf); return (ulonglong) times(&times_buf);
} }
#elif defined(__NETWARE__)
{
NXTime_t tm;
NXGetTime(NX_SINCE_BOOT, NX_TICKS, &tm);
return (ulonglong) tm;
}
#elif defined(_WIN32) #elif defined(_WIN32)
return (ulonglong) GetTickCount(); return (ulonglong) GetTickCount();
#else #else
@ -583,8 +555,6 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->nanoseconds.routine= MY_TIMER_ROUTINE_GETHRTIME; mti->nanoseconds.routine= MY_TIMER_ROUTINE_GETHRTIME;
#elif defined(HAVE_CLOCK_GETTIME) #elif defined(HAVE_CLOCK_GETTIME)
mti->nanoseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME; mti->nanoseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME;
#elif defined(__NETWARE__)
mti->nanoseconds.routine= MY_TIMER_ROUTINE_NXGETTIME;
#elif defined(__APPLE__) && defined(__MACH__) #elif defined(__APPLE__) && defined(__MACH__)
mti->nanoseconds.routine= MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME; mti->nanoseconds.routine= MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME;
#else #else
@ -614,8 +584,6 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->microseconds.routine= MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER; mti->microseconds.routine= MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER;
} }
} }
#elif defined(__NETWARE__)
mti->microseconds.routine= MY_TIMER_ROUTINE_NXGETTIME;
#else #else
mti->microseconds.routine= 0; mti->microseconds.routine= 0;
#endif #endif
@ -633,8 +601,6 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->milliseconds.routine= MY_TIMER_ROUTINE_FTIME; mti->milliseconds.routine= MY_TIMER_ROUTINE_FTIME;
#elif defined(_WIN32) #elif defined(_WIN32)
mti->milliseconds.routine= MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME; mti->milliseconds.routine= MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME;
#elif defined(__NETWARE__)
mti->milliseconds.routine= MY_TIMER_ROUTINE_NXGETTIME;
#elif defined(HAVE_TIME) #elif defined(HAVE_TIME)
mti->milliseconds.routine= MY_TIMER_ROUTINE_TIME; mti->milliseconds.routine= MY_TIMER_ROUTINE_TIME;
#else #else
@ -652,8 +618,6 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->ticks.frequency= 100; /* permanent assumption */ mti->ticks.frequency= 100; /* permanent assumption */
#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES) #if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES)
mti->ticks.routine= MY_TIMER_ROUTINE_TIMES; mti->ticks.routine= MY_TIMER_ROUTINE_TIMES;
#elif defined(__NETWARE__)
mti->ticks.routine= MY_TIMER_ROUTINE_NXGETTIME;
#elif defined(_WIN32) #elif defined(_WIN32)
mti->ticks.routine= MY_TIMER_ROUTINE_GETTICKCOUNT; mti->ticks.routine= MY_TIMER_ROUTINE_GETTICKCOUNT;
#else #else
@ -998,7 +962,7 @@ void my_timer_init(MY_TIMER_INFO *mti)
We tested with AIX, Solaris (x86 + Sparc), Linux (x86 + We tested with AIX, Solaris (x86 + Sparc), Linux (x86 +
Itanium), Windows, 64-bit Windows, QNX, FreeBSD, HPUX, Itanium), Windows, 64-bit Windows, QNX, FreeBSD, HPUX,
Irix, Mac. We didn't test with NetWare or SCO. Irix, Mac. We didn't test with SCO.
*/ */

View File

@ -76,7 +76,7 @@ end:
int my_copystat(const char *from, const char *to, int MyFlags) int my_copystat(const char *from, const char *to, int MyFlags)
{ {
struct stat statbuf; struct stat statbuf;
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
int res; int res;
#endif #endif
@ -91,14 +91,14 @@ int my_copystat(const char *from, const char *to, int MyFlags)
return 1; return 1;
(void) chmod(to, statbuf.st_mode & 07777); /* Copy modes */ (void) chmod(to, statbuf.st_mode & 07777); /* Copy modes */
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__)
if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING) if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING)
{ {
if (MyFlags & MY_LINK_WARNING) if (MyFlags & MY_LINK_WARNING)
my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink); my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
} }
res= chown(to, statbuf.st_uid, statbuf.st_gid); /* Copy ownership */ res= chown(to, statbuf.st_uid, statbuf.st_gid); /* Copy ownership */
#endif /* !__WIN__ && !__NETWARE__ */ #endif /* !__WIN__ */
#ifndef VMS #ifndef VMS
#ifndef __ZTC__ #ifndef __ZTC__

View File

@ -44,7 +44,7 @@ int my_rename(const char *from, const char *to, myf MyFlags)
} }
#endif #endif
#if defined(HAVE_RENAME) #if defined(HAVE_RENAME)
#if defined(__WIN__) || defined(__NETWARE__) #if defined(__WIN__)
/* /*
On windows we can't rename over an existing file: On windows we can't rename over an existing file:
Remove any conflicting files: Remove any conflicting files:

View File

@ -20,9 +20,7 @@
void my_sleep(ulong m_seconds) void my_sleep(ulong m_seconds)
{ {
#ifdef __NETWARE__ #if defined(__WIN__)
delay(m_seconds/1000+1);
#elif defined(__WIN__)
Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */
#elif defined(HAVE_SELECT) #elif defined(HAVE_SELECT)
struct timeval t; struct timeval t;

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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 \
"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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)

View File

@ -1,2 +0,0 @@
kYieldIfTimeSliceUp

View File

@ -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'

View File

@ -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'

View File

@ -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

View File

@ -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'

View File

@ -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"

View File

@ -1,9 +0,0 @@
WS2_32_shutdown
WS2_32_closesocket
WSASetLastError
WS2_32_recv
WSASetLastError
WS2_32_send
WSAGetLastError
GetProcessSwitchCount
RunningProcess

View File

@ -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

View File

@ -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 > $@;

View File

@ -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

View File

@ -1 +0,0 @@
# This functionality is handled by mysql-test-run.nlm on NetWare

View File

@ -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

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Binary file not shown.

View File

@ -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

View File

@ -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";

View File

@ -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;
}

View File

@ -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

View File

@ -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";

Some files were not shown because too many files have changed in this diff Show More