summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-01-28 08:38:28 +0200
committerunknown <monty@mashka.mysql.fi>2003-01-28 08:38:28 +0200
commit84f81dc593e8e21cbfb4596aef375d45e3a26ba8 (patch)
treeb916d4acfbe4f32ab06b052fd06c072f858bdce1
parent49e0eea578eb119cafb2df1ba77b35fcf8391224 (diff)
downloadmariadb-git-84f81dc593e8e21cbfb4596aef375d45e3a26ba8.tar.gz
Fixes for Netware
Call pthread_mutex_destroy() on not used mutex. Changed comments in .h and .c files from // -> /* */ Added detection of mutex on which one didn't call pthread_mutex_destroy() Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression" Added optimisation for ORDER BY NULL BitKeeper/deleted/.del-ChangeLog~dfc92e15bee6fc75: Delete: sql/ChangeLog BUILD/compile-pentium-valgrind-max: Don't use valgrind with safemalloc as this can hide some bugs Makefile.am: Added platform dirs bdb/os/os_handle.c: Portability fix client/mysql.cc: Fixes for Netware. Fixed duplicate output when using 'tee' Simple optimisations client/mysqldump.c: Portability fix client/mysqltest.c: Portability fix configure.in: Fixes for Netware extra/resolveip.c: Fixes for Netware include/Makefile.am: Fixes for Netware include/config-win.h: Portability fix include/my_global.h: Fixes for Netware include/my_net.h: Fixes for Netware include/my_pthread.h: Fixes for Netware Added detection of mutexes that was not destroyed include/my_sys.h: Fixes for Netware Added 'extern' before external functions include/mysql.h: Fixes for Netware innobase/configure.in: Fixes for Netware innobase/include/os0thread.h: Fixes for Netware innobase/os/os0sync.c: Fixes for Netware innobase/os/os0thread.c: Fixes for Netware innobase/srv/srv0srv.c: Fixes for Netware innobase/srv/srv0start.c: Fixes for Netware innobase/sync/sync0sync.c: Fixes for Netware isam/test3.c: Disable test on Netware libmysql/Makefile.shared: Added my_sleep libmysql/get_password.c: Fixes for Netware libmysql/libmysql.c: Fixes for Netware Made mysql_once_init() global libmysql/manager.c: Fixes for Netware myisam/mi_test3.c: Disable test for netware mysql-test/mysql-test-run.sh: Give warning if output file contains errors mysql-test/r/count_distinct.result: More tests mysql-test/r/group_by.result: Test of ORDER BY NULL mysql-test/t/backup.test: Fixes for Netware mysql-test/t/count_distinct.test: More tests mysql-test/t/func_crypt.test: Fixes for Netware mysql-test/t/grant_cache.test: Fixes for Netware mysql-test/t/group_by.test: Tests of ORDER BY NULL mysql-test/t/rpl000015.test: Fixes for Netware mysql-test/t/rpl000017.test: Fixes for Netware mysql-test/t/rpl_rotate_logs.test: Fixes for Netware mysys/Makefile.am: Added my_sleep.c and my_netware.c mysys/charset.c: Fixes for Netware mysys/default.c: Fixes for Netware mysys/mf_tempfile.c: Fixes for Netware mysys/my_clock.c: Fixes for Netware mysys/my_copy.c: Fixes for Netware mysys/my_getwd.c: Changed function comment from // -> /* */ mysys/my_init.c: Fixes for Netware mysys/my_lock.c: Fixes for Netware mysys/my_messnc.c: Fixes for Netware mysys/my_os2cond.c: Removed comment mysys/my_os2dirsrch.c: Changed function comment from // -> /* */ Fixed indentation mysys/my_os2dirsrch.h: Changed function comment from // -> /* */ Fixed indentation mysys/my_os2file64.c: Changed function comment from // -> /* */ Fixed indentation mysys/my_os2mutex.c: Changed function comment from // -> /* */ Fixed indentation mysys/my_os2thread.c: Changed function comment from // -> /* */ Fixed indentation mysys/my_os2tls.c: Changed function comment from // -> /* */ Fixed indentation mysys/my_pthread.c: Fixes for Netware mysys/my_redel.c: Fixes for Netware mysys/my_tempnam.c: Fixes for Netware mysys/my_thr_init.c: Remove created mutexes when program ends. mysys/mysys_priv.h: Cleanup mysys/safemalloc.c: Prefix error messages with "Error:" mysys/thr_alarm.c: Destroy internal mutex on end_thr_alarm. mysys/thr_mutex.c: Added detection of mutex on which one didn't call pthread_mutex_destroy() scripts/make_binary_distribution.sh: Fixes for Netware sql/des_key_file.cc: Free mutex at end sql/ha_innodb.cc: Free mutex at end sql/ha_myisam.cc: Changed warnings from REPAIR Note: (For mysql-test-run) sql/hostname.cc: Fixes for Netware sql/item.h: Fixed bug in create_tmp_field() which causes a memory overrun sql/item_func.cc: Free used mutexes sql/item_sum.cc: Fixed bug in create_tmp_field() which causes a memory overrun sql/log.cc: Free used mutexes sql/my_lock.c: Fixes for Netware sql/mysql_priv.h: Fixes for Netware sql/mysqld.cc: Fixes for Netware Added Have_crypt Properly free mutexes from MYSQL_LOG by calling cleanup Free mutex before exit sql/repl_failsafe.cc: Fixes for Netware sql/set_var.cc: Added have_crypt sql/share/english/errmsg.txt: Added version socket and port to stderr log sql/slave.cc: Remove global MASTER_INFO variable and use instead an allocated variable. This allows us to correctly free used mutex. sql/slave.h: Move constructors and destuctors to slave.cc (To make it easier to clear all needed variables) sql/sql_base.cc: Safety fix sql/sql_class.h: Portability fixes. Added 'cleanup' to log handling to be able to free mutexes. sql/sql_insert.cc: Fixes for Netware mysys/my_sleep.c: E sql/sql_parse.cc: Fixes for Netware sql/sql_select.cc: Added optimisation for ORDER BY NULL sql/sql_select.h: Fixed bug in create_tmp_field() which causes a memory overrun sql/sql_table.cc: Fixed bug in create_tmp_field() which causes a memory overrun sql/sql_udf.cc: Free mutex on end vio/test-ssl.c: Simple code cleanup vio/test-sslclient.c: Simple code cleanup vio/test-sslserver.c: Simple code cleanup vio/viotest-ssl.c: Simple code cleanup
-rwxr-xr-xBUILD/compile-pentium-valgrind-max2
-rw-r--r--Makefile.am3
-rw-r--r--bdb/os/os_handle.c2
-rw-r--r--client/mysql.cc157
-rw-r--r--client/mysqldump.c2
-rw-r--r--client/mysqltest.c18
-rw-r--r--configure.in214
-rw-r--r--extra/resolveip.c5
-rw-r--r--include/Makefile.am2
-rw-r--r--include/config-netware.h86
-rw-r--r--include/config-win.h3
-rw-r--r--include/my_global.h19
-rw-r--r--include/my_net.h2
-rw-r--r--include/my_pthread.h38
-rw-r--r--include/my_sys.h43
-rw-r--r--include/mysql.h11
-rw-r--r--innobase/configure.in20
-rw-r--r--innobase/include/os0thread.h3
-rw-r--r--innobase/os/os0sync.c2
-rw-r--r--innobase/os/os0thread.c2
-rw-r--r--innobase/srv/srv0srv.c55
-rw-r--r--innobase/srv/srv0start.c22
-rw-r--r--innobase/sync/sync0sync.c2
-rw-r--r--isam/test3.c14
-rw-r--r--libmysql/Makefile.shared2
-rw-r--r--libmysql/get_password.c22
-rw-r--r--libmysql/libmysql.c36
-rw-r--r--libmysql/manager.c4
-rw-r--r--myisam/mi_test3.c14
-rw-r--r--mysql-test/include/have_crypt.inc4
-rw-r--r--mysql-test/mysql-test-run.sh25
-rw-r--r--mysql-test/r/count_distinct.result4
-rw-r--r--mysql-test/r/group_by.result48
-rw-r--r--mysql-test/r/have_crypt.require2
-rw-r--r--mysql-test/t/backup.test2
-rw-r--r--mysql-test/t/count_distinct.test1
-rw-r--r--mysql-test/t/func_crypt.test2
-rw-r--r--mysql-test/t/grant_cache.test17
-rw-r--r--mysql-test/t/group_by.test21
-rw-r--r--mysql-test/t/rpl000015.test4
-rw-r--r--mysql-test/t/rpl000017.test4
-rw-r--r--mysql-test/t/rpl_rotate_logs.test4
-rw-r--r--mysys/Makefile.am25
-rw-r--r--mysys/charset.c4
-rw-r--r--mysys/default.c4
-rw-r--r--mysys/mf_tempfile.c6
-rw-r--r--mysys/my_clock.c4
-rw-r--r--mysys/my_copy.c2
-rw-r--r--mysys/my_getwd.c2
-rw-r--r--mysys/my_init.c107
-rw-r--r--mysys/my_lock.c54
-rw-r--r--mysys/my_messnc.c4
-rw-r--r--mysys/my_netware.c150
-rw-r--r--mysys/my_os2cond.c1
-rw-r--r--mysys/my_os2dirsrch.c192
-rw-r--r--mysys/my_os2dirsrch.h57
-rw-r--r--mysys/my_os2file64.c389
-rw-r--r--mysys/my_os2mutex.c53
-rw-r--r--mysys/my_os2thread.c3
-rw-r--r--mysys/my_os2tls.c201
-rw-r--r--mysys/my_pthread.c13
-rw-r--r--mysys/my_redel.c2
-rw-r--r--mysys/my_sleep.c (renamed from mysys/mf_sleep.c)29
-rw-r--r--mysys/my_tempnam.c10
-rw-r--r--mysys/my_thr_init.c12
-rw-r--r--mysys/mysys_priv.h6
-rw-r--r--mysys/safemalloc.c56
-rw-r--r--mysys/thr_alarm.c19
-rw-r--r--mysys/thr_mutex.c119
-rw-r--r--netware/Makefile.am0
-rw-r--r--netware/netware.patch4162
-rw-r--r--scripts/make_binary_distribution.sh140
-rw-r--r--sql/ChangeLog3307
-rw-r--r--sql/des_key_file.cc11
-rw-r--r--sql/ha_innodb.cc1
-rw-r--r--sql/ha_myisam.cc6
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/item.h16
-rw-r--r--sql/item_func.cc1
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/log.cc11
-rw-r--r--sql/my_lock.c2
-rw-r--r--sql/mysql_priv.h4
-rw-r--r--sql/mysqld.cc269
-rw-r--r--sql/repl_failsafe.cc2
-rw-r--r--sql/set_var.cc1
-rw-r--r--sql/share/english/errmsg.txt2
-rw-r--r--sql/slave.cc108
-rw-r--r--sql/slave.h31
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_class.h11
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_parse.cc10
-rw-r--r--sql/sql_select.cc44
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_udf.cc5
-rw-r--r--vio/test-ssl.c182
-rw-r--r--vio/test-sslclient.c3
-rw-r--r--vio/test-sslserver.c3
-rw-r--r--vio/viotest-ssl.c204
101 files changed, 6632 insertions, 4385 deletions
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index 016b698a970..14f57d24841 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -3,7 +3,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags -DHAVE_purify"
+extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -DHAVE_purify"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
diff --git a/Makefile.am b/Makefile.am
index d3d50e9638f..a03ca058b3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,7 +25,8 @@ SUBDIRS = . include @docs_dirs@ @readline_dir@ \
@thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests \
BUILD os2 @libmysqld_dirs@ \
- @bench_dirs@ support-files @fs_dirs@ @tools_dirs@
+ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ \
+ @platform_dir@
# Relink after clean
linked_sources = linked_client_sources linked_server_sources \
diff --git a/bdb/os/os_handle.c b/bdb/os/os_handle.c
index b127c5ff506..d85b13a6602 100644
--- a/bdb/os/os_handle.c
+++ b/bdb/os/os_handle.c
@@ -121,7 +121,7 @@ __os_openhandle(dbenv, name, flags, mode, fhp)
} else {
#if defined(HAVE_FCNTL_F_SETFD)
/* Deny file descriptor access to any child process. */
- if (fcntl(fhp->fd, F_SETFD, 1) == -1) {
+ if (fcntl(fhp->fd, F_SETFD, FD_CLOEXEC) == -1) {
ret = __os_get_errno();
__db_err(dbenv, "fcntl(F_SETFD): %s",
strerror(ret));
diff --git a/client/mysql.cc b/client/mysql.cc
index 330665dde2a..62bdbe15b46 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002 MySQL AB
+/* Copyright (C) 2000-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
@@ -40,7 +40,7 @@
#include <signal.h>
#include <violite.h>
-const char *VER= "12.16";
+const char *VER= "12.17";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
@@ -79,7 +79,7 @@ extern "C" {
#undef bcmp // Fix problem with new readline
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
-#else
+#elif !defined(__NETWARE__)
#include <readline/readline.h>
#define HAVE_READLINE
#endif
@@ -91,12 +91,16 @@ extern "C" {
#define vidattr(A) {} // Can't get this to work
#endif
-#ifdef __WIN__
+#ifdef FN_NO_CASE_SENCE
#define cmp_database(A,B) my_strcasecmp((A),(B))
#else
#define cmp_database(A,B) strcmp((A),(B))
#endif
+#if !defined( __WIN__) && !defined( OS2) && !defined(__NETWARE__) && (!defined(HAVE_mit_thread) || !defined(THREAD))
+#define USE_POPEN
+#endif
+
#include "completion_hash.h"
#define PROMPT_CHAR '\\'
@@ -171,12 +175,12 @@ static int com_quit(String *str,char*),
com_connect(String *str,char*), com_status(String *str,char*),
com_use(String *str,char*), com_source(String *str, char*),
com_rehash(String *str, char*), com_tee(String *str, char*),
- com_notee(String *str, char*), com_shell(String *str, char *),
+ com_notee(String *str, char*),
com_prompt(String *str, char*);
-#ifndef __WIN__
+#ifdef USE_POPEN
static int com_nopager(String *str, char*), com_pager(String *str, char*),
- com_edit(String *str,char*);
+ com_edit(String *str,char*), com_shell(String *str, char *);
#endif
static int read_lines(bool execute_commands);
@@ -187,7 +191,7 @@ static void safe_put_field(const char *pos,ulong length);
static void xmlencode_print(const char *src, uint length);
static void init_pager();
static void end_pager();
-static int init_tee(char *);
+static void init_tee(const char *);
static void end_tee();
static const char* construct_prompt();
static void init_username();
@@ -210,18 +214,18 @@ static COMMANDS commands[] = {
{ "clear", 'c', com_clear, 0, "Clear command."},
{ "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." },
-#ifndef __WIN__
+#ifdef USE_POPEN
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
#endif
{ "ego", 'G', com_ego, 0,
"Send command to mysql server, display result vertically."},
{ "exit", 'q', com_quit, 0, "Exit mysql. Same as quit."},
{ "go", 'g', com_go, 0, "Send command to mysql server." },
-#ifndef __WIN__
+#ifdef USE_POPEN
{ "nopager",'n', com_nopager,0, "Disable pager, print to stdout." },
#endif
{ "notee", 't', com_notee, 0, "Don't write into outfile." },
-#ifndef __WIN__
+#ifdef USE_POPEN
{ "pager", 'P', com_pager, 1,
"Set PAGER [to_pager]. Print the query results via PAGER." },
#endif
@@ -232,7 +236,7 @@ static COMMANDS commands[] = {
{ "source", '.', com_source, 1,
"Execute a SQL script file. Takes a file name as an argument."},
{ "status", 's', com_status, 0, "Get status information from the server."},
-#ifndef __WIN__
+#ifdef USE_POPEN
{ "system", '!', com_shell, 1, "Execute a system shell command."},
#endif
{ "tee", 'T', com_tee, 1,
@@ -302,8 +306,8 @@ int main(int argc,char *argv[])
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
prompt_counter=0;
- strmov(outfile, "\0"); // no (default) outfile, unless given at least once
- strmov(pager, "stdout"); // the default, if --pager wasn't given
+ outfile[0]=0; // no (default) outfile
+ strmov(pager, "stdout"); // the default, if --pager wasn't given
{
char *tmp=getenv("PAGER");
if (tmp)
@@ -491,7 +495,7 @@ static struct my_option my_long_options[] =
NO_ARG, 1, 0, 0, 0, 0, 0},
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef __WIN__
+#ifdef USE_POPEN
{"no-pager", OPT_NOPAGER,
"Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -512,7 +516,7 @@ static struct my_option my_long_options[] =
{"one-database", 'o',
"Only update the default database. This is useful for skipping updates to other database in the update log.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifndef __WIN__
+#ifdef USE_POPEN
{"pager", OPT_PAGER,
"Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -619,7 +623,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
end_tee();
}
else
- opt_outfile= init_tee(argument);
+ init_tee(argument);
break;
case OPT_NOTEE:
printf("WARNING: option deprecated; use --disable-tee instead.\n");
@@ -772,7 +776,7 @@ static int get_options(int argc, char **argv)
static int read_lines(bool execute_commands)
{
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
char linebuffer[254];
#endif
char *line;
@@ -792,30 +796,33 @@ static int read_lines(bool execute_commands)
}
else
{
-#if defined( __WIN__) || defined(OS2)
+ char *prompt= (char*) (glob_buffer.is_empty() ? construct_prompt() :
+ !in_string ? " -> " :
+ in_string == '\'' ?
+ " '> " : " \"> ");
if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE);
- tee_fputs(glob_buffer.is_empty() ? construct_prompt() :
- !in_string ? " -> " :
- in_string == '\'' ?
- " '> " : " \"> ",stdout);
- linebuffer[0]=(char) sizeof(linebuffer);
- line=_cgets(linebuffer);
-#else
- if (opt_outfile)
+
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
+ tee_fputs(prompt, stdout);
+#ifdef __NETWARE__
+ line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
+ /* Remove the '\n' */
{
- if (glob_buffer.is_empty())
- fflush(OUTFILE);
- fputs(glob_buffer.is_empty() ? construct_prompt() :
- !in_string ? " -> " :
- in_string == '\'' ?
- " '> " : " \"> ", OUTFILE);
+ char *p = strrchr(line, '\n');
+ if (p != NULL)
+ *p = '\0';
}
- line=readline((char*) (glob_buffer.is_empty() ? construct_prompt() :
- !in_string ? " -> " :
- in_string == '\'' ?
- " '> " : " \"> "));
-#endif
+#else
+ linebuffer[0]= (char) sizeof(linebuffer);
+ line= _cgets(linebuffer);
+#endif /* __NETWARE__ */
+#else
+ if (opt_outfile)
+ fputs(prompt, OUTFILE);
+ line= readline(prompt);
+#endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */
+
if (opt_outfile)
fprintf(OUTFILE, "%s\n", line);
}
@@ -1497,7 +1504,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
static void init_pager()
{
-#if !defined( __WIN__) && !defined( OS2) && (!defined(HAVE_mit_thread) || !defined(THREAD))
+#ifdef USE_POPEN
if (!opt_nopager)
{
if (!(PAGER= popen(pager, "w")))
@@ -1513,30 +1520,35 @@ static void init_pager()
static void end_pager()
{
-#if !defined( __WIN__) && !defined( OS2) && !(defined(HAVE_mit_thread) && defined(THREAD))
+#ifdef USE_POPEN
if (!opt_nopager)
pclose(PAGER);
#endif
}
-static int init_tee(char* newfile)
+static void init_tee(const char *file_name)
{
FILE* new_outfile;
- if (!(new_outfile= my_fopen(newfile, O_APPEND | O_WRONLY, MYF(MY_WME))))
- return 0;
if (opt_outfile)
end_tee();
+ if (!(new_outfile= my_fopen(file_name, O_APPEND | O_WRONLY, MYF(MY_WME))))
+ {
+ tee_fprintf(stdout, "Error logging to file '%s'\n", file_name);
+ return;
+ }
OUTFILE = new_outfile;
- strmake(outfile,newfile,FN_REFLEN-1);
- tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
- return 1;
+ strmake(outfile, file_name, FN_REFLEN-1);
+ tee_fprintf(stdout, "Logging to file '%s'\n", file_name);
+ opt_outfile= 1;
+ return;
}
static void end_tee()
{
my_fclose(OUTFILE, MYF(0));
+ OUTFILE= 0;
opt_outfile= 0;
return;
}
@@ -1576,6 +1588,9 @@ print_table_data(MYSQL_RES *result)
MYSQL_ROW cur;
MYSQL_FIELD *field;
bool *num_flag;
+#ifdef __NETWARE__
+ uint lines= 0;
+#endif
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
if (info_flag)
@@ -1631,16 +1646,24 @@ print_table_data(MYSQL_RES *result)
length, str);
}
(void) tee_fputs("\n", PAGER);
+#ifdef __NETWARE__
+ // on a long result the screen could hog the cpu
+ if ((lines++ & 1023) == 0) pthread_yield();
+#endif
}
tee_puts(separator.c_ptr(), PAGER);
my_afree((gptr) num_flag);
}
+
static void
print_table_data_html(MYSQL_RES *result)
{
- MYSQL_ROW cur;
- MYSQL_FIELD *field;
+ MYSQL_ROW cur;
+ MYSQL_FIELD *field;
+#ifdef __NETWARE__
+ uint lines= 0;
+#endif
mysql_field_seek(result,0);
(void) tee_fputs("<TABLE BORDER=1><TR>", PAGER);
@@ -1665,6 +1688,10 @@ print_table_data_html(MYSQL_RES *result)
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
+#ifdef __NETWARE__
+ // on a long result the screen could hog the cpu
+ if ((lines++ & 1023) == 0) pthread_yield();
+#endif
}
(void) tee_fputs("</TABLE>", PAGER);
}
@@ -1698,6 +1725,10 @@ print_table_data_xml(MYSQL_RES *result)
" &nbsp; ") : "NULL"));
}
(void) tee_fputs(" </row>\n", PAGER);
+#ifdef __NETWARE__
+ // on a long result the screen could hog the cpu
+ if ((lines++ & 1023) == 0) pthread_yield();
+#endif
}
(void) tee_fputs("</resultset>\n", PAGER);
}
@@ -1730,6 +1761,10 @@ print_table_data_vertically(MYSQL_RES *result)
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
tee_fprintf(PAGER, "%s\n",cur[off] ? (char*) cur[off] : "NULL");
}
+#ifdef __NETWARE__
+ // on a long result the screen could hog the cpu
+ if ((row_count & 1023) == 0) pthread_yield();
+#endif
}
}
@@ -1869,11 +1904,7 @@ com_tee(String *buffer, char *line __attribute__((unused)))
printf("No outfile specified!\n");
return 0;
}
- opt_outfile= init_tee(file_name);
- if (opt_outfile)
- tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
- else
- tee_fprintf(stdout, "Error logging to file '%s'\n",file_name);
+ init_tee(file_name);
return 0;
}
@@ -1892,7 +1923,7 @@ com_notee(String *buffer __attribute__((unused)),
Sorry, this command is not available in Windows.
*/
-#ifndef __WIN__
+#ifdef USE_POPEN
static int
com_pager(String *buffer, char *line __attribute__((unused)))
{
@@ -1903,9 +1934,9 @@ com_pager(String *buffer, char *line __attribute__((unused)))
/* Skip space from file name */
while (isspace(*line))
line++;
- if (!(param = strchr(line, ' '))) // if pager was not given, use the default
+ if (!(param= strchr(line, ' '))) // if pager was not given, use the default
{
- if (!strlen(default_pager))
+ if (!default_pager[0])
{
tee_fprintf(stdout, "Default pager wasn't set, using stdout.\n");
opt_nopager=1;
@@ -1948,7 +1979,7 @@ com_nopager(String *buffer __attribute__((unused)),
Sorry, you can't send the result to an editor in Win32
*/
-#ifndef __WIN__
+#ifdef USE_POPEN
static int
com_edit(String *buffer,char *line __attribute__((unused)))
{
@@ -1996,6 +2027,10 @@ static int
com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
+#ifdef __NETWARE__
+ // let the screen auto close on a normal shutdown
+ setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
+#endif
status.exit_status=0;
return 1;
}
@@ -2011,7 +2046,7 @@ com_rehash(String *buffer __attribute__((unused)),
}
-#ifndef __WIN__
+#ifdef USE_POPEN
static int
com_shell(String *buffer, char *line __attribute__((unused)))
{
@@ -2327,7 +2362,7 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf(stdout, "\nAll updates ignored to this database\n");
vidattr(A_NORMAL);
}
-#ifndef __WIN__
+#ifdef USE_POPEN
tee_fprintf(stdout, "Current pager:\t\t%s\n", pager);
tee_fprintf(stdout, "Using outfile:\t\t'%s'\n", opt_outfile ? outfile : "");
#endif
@@ -2500,7 +2535,7 @@ void tee_putc(int c, FILE *file)
putc(c, OUTFILE);
}
-#if defined( __WIN__) || defined( OS2)
+#if defined( __WIN__) || defined( OS2) || defined(__NETWARE__)
#include <time.h>
#else
#include <sys/times.h>
@@ -2512,7 +2547,7 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void)
{
-#if defined( __WIN__) || defined( OS2)
+#if defined( __WIN__) || defined( OS2) || defined(__NETWARE__)
return clock();
#else
struct tms tms_tmp;
diff --git a/client/mysqldump.c b/client/mysqldump.c
index a6eaf1794fd..023e35cf7c9 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -341,7 +341,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
tty_password=1;
break;
case 'r':
- if (!(md_result_file = my_fopen(argument, O_WRONLY | O_BINARY,
+ if (!(md_result_file = my_fopen(argument, O_WRONLY | FILE_BINARY,
MYF(MY_WME))))
exit(1);
break;
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 9e411e5f28f..cad13fe1349 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -677,7 +677,7 @@ int open_file(const char* name)
if (*cur_file && cur_file == file_stack_end)
die("Source directives are nesting too deep");
- if (!(*(cur_file+1) = my_fopen(buff, O_RDONLY | O_BINARY, MYF(MY_WME))))
+ if (!(*(cur_file+1) = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
die(NullS);
cur_file++;
*++lineno=1;
@@ -685,18 +685,6 @@ int open_file(const char* name)
return 0;
}
-static void my_sleep(ulong m_seconds)
-{
-#ifndef OS2
- struct timeval t;
- t.tv_sec= m_seconds / 1000000L;
- t.tv_usec= m_seconds % 1000000L;
- select(0,0,0,0,&t); /* sleep */
-#else
- DosSleep(m_seconds/1000+1);
-#endif
-}
-
/* ugly long name, but we are following the convention */
int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
@@ -1912,7 +1900,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
argument= buff;
}
fn_format(buff, argument, "", "", 4);
- if (!(*++cur_file = my_fopen(buff, O_RDONLY | O_BINARY, MYF(MY_WME))))
+ if (!(*++cur_file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
die("Could not open %s: errno = %d", argument, errno);
break;
}
@@ -2561,7 +2549,7 @@ static int read_server_arguments(const char* name)
embedded_server_arg_count=1;
embedded_server_args[0]= (char*) ""; /* Progname */
}
- if (!(file=my_fopen(buff, O_RDONLY | O_BINARY, MYF(MY_WME))))
+ if (!(file=my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
return 1;
while (embedded_server_arg_count < MAX_SERVER_ARGS &&
(str=fgets(argument,sizeof(argument), file)))
diff --git a/configure.in b/configure.in
index 92eaf3db151..6e1e274fe3c 100644
--- a/configure.in
+++ b/configure.in
@@ -38,9 +38,18 @@ rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
for i in $AVAILABLE_LANGUAGES
do
AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys"
+ case $SYSTEM_TYPE in
+ *netware* | *modesto*)
+ echo "$i/errmsg.sys: $i/errmsg.txt
+ \$(top_builddir)/extra/comp_err.cyg \$^ $i/errmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ *)
echo "$i/errmsg.sys: $i/errmsg.txt
\$(top_builddir)/extra/comp_err \$^ $i/errmsg.sys" \
>> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ esac
done
#####
@@ -130,7 +139,14 @@ AC_PROG_CXX
AC_PROG_CPP
# 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`
+ ;;
+esac
if test $? -eq "0"
then
AC_MSG_CHECKING("C Compiler version");
@@ -138,7 +154,14 @@ then
else
CC_VERSION=""
fi
+case $SYSTEM_TYPE in
+ *netware*)
+CXX_VERSION=`$CXX -version | grep -i version`
+ ;;
+ *)
CXX_VERSION=`$CXX --version | sed 1q`
+ ;;
+esac
if test $? -eq "0"
then
AC_MSG_CHECKING("C++ compiler version");
@@ -186,6 +209,11 @@ AC_CHECK_PROG(DVIS, tex, manual.dvi)
AC_MSG_CHECKING("return type of sprintf")
#check the return type of sprintf
+case $SYSTEM_TYPE in
+ *netware*)
+ AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int")
+ ;;
+ *)
AC_TRY_RUN([
int main()
{
@@ -205,11 +233,13 @@ AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int"),
char buf[6];
if((char*)sprintf(buf,s) == buf + strlen(s))
return 0;
- return -1;
+ return -1;
}
], AC_DEFINE(SPRINTF_RETURNS_PTR) AC_MSG_RESULT("ptr"),
AC_DEFINE(SPRINTF_RETURNS_GARBAGE) AC_MSG_RESULT("garbage")))
-
+ ;;
+esac
+
# option, cache_name, variable,
# code to execute if yes, code to exectute if fail
@@ -361,10 +391,12 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln)
+if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
# If ln -f does not exists use -s (AFS systems)
if test -n "$LN_CP_F"; then
LN_CP_F="$LN_CP_F -s"
fi
+fi
AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm)
@@ -429,6 +461,9 @@ else
*cygwin*)
FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null"
;;
+ *netware* | *modesto*)
+ FIND_PROC=
+ ;;
*)
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
esac
@@ -853,6 +888,11 @@ fi
NON_THREADED_CLIENT_LIBS="$LIBS"
AC_MSG_CHECKING([for int8])
+case $SYSTEM_TYPE in
+ *netware)
+ AC_MSG_RESULT([no])
+ ;;
+ *)
AC_TRY_RUN([
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -873,6 +913,8 @@ int main()
}
], AC_DEFINE(HAVE_INT_8_16_32) AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])
)
+ ;;
+esac
#
# Some system specific hacks
@@ -1022,6 +1064,107 @@ dnl Is this the right match for DEC OSF on alpha?
CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R"
;;
+ *netware*)
+ # No need for curses library so set it to null
+ with_named_curses=""
+
+ #
+ # Edit Makefile.in files.
+ #
+ echo -n "configuring Makefile.in files for NetWare... "
+ for file in sql/Makefile.in libmysql/Makefile.in libmysql_r/Makefile.in sql/share/Makefile.in strings/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.cyg instead of gen_lex_hash
+ # Add library dependencies to mysqld_DEPENDENCIES
+ lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
+ cat > $filesed << EOF
+s,\(^.*\$(MAKE) gen_lex_hash\),#\1,
+s,\(\./gen_lex_hash\),\1.cyg,
+s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
+EOF
+ ;;
+ sql/share/Makefile.in)
+ cat > $filesed << EOF
+s,\(extra/comp_err\),\1.cyg,
+EOF
+ ;;
+ libmysql/Makefile.in)
+ cat > $filesed << EOF
+s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2,
+s,\(: conf_to_src\),\1.cyg,
+EOF
+ ;;
+ libmysql_r/Makefile.in)
+ cat > $filesed << EOF
+s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2,
+s,\(: conf_to_src\),\1.cyg,
+EOF
+ ;;
+ strings/Makefile.in)
+ cat > $filesed << EOF
+s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.cyg\2,
+s,\(: conf_to_src\),\1.cyg,
+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/include.texi \
+ Docs/mysql.info \
+ Docs/manual.txt \
+ Docs/manual_toc.html \
+ Docs/manual.html \
+ Docs/INSTALL-BINARY \
+ INSTALL-SOURCE \
+ COPYING \
+ COPYING.LIB \
+ MIRRORS
+ do
+ if test -e $file; then
+ chmod +w $file
+ fi
+ done
+ echo "done"
+
+ ;;
esac
@@ -1389,7 +1532,12 @@ LIBS="$my_save_LIBS"
AC_SUBST(LIBDL)
# System characteristics
+case $SYSTEM_TYPE in
+ *netware* | *modesto*) ;;
+ *)
AC_SYS_RESTARTABLE_SYSCALLS
+ ;;
+esac
# Build optimized or debug version ?
# First check for gcc and g++
@@ -1414,6 +1562,13 @@ else
OPTIMIZE_CXXFLAGS="-O"
fi
+if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
+ DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG -sym internal,codeview4"
+ DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -DDEBUG -sym internal,codeview4"
+ OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -DNDEBUG"
+ OPTIMIZE_CXXFLAGS="$OPTIMIZE_CXXFLAGS -DNDEBUG"
+fi
+
AC_ARG_WITH(debug,
[ --without-debug Build a production version without debugging code],
[with_debug=$withval],
@@ -1561,6 +1716,7 @@ MYSQL_CHECK_FP_EXCEPT
# Do the c++ compiler have a bool type
MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc
+if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
MYSQL_CHECK_LONGLONG_TO_FLOAT
if test "$ac_cv_conv_longlong_to_float" != "yes"
then
@@ -1568,6 +1724,7 @@ then
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
again]);
fi
+fi
MYSQL_PTHREAD_YIELD
######################################################################
@@ -1988,6 +2145,11 @@ AC_ARG_WITH(readline,
[ with_readline=$withval ],
[ with_readline=yes ]
)
+if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
+ # For NetWare, do not need readline
+ readline_dir=""
+ readline_link=""
+else
if test "$with_readline" = "yes"
then
readline_dir="readline"
@@ -1998,6 +2160,7 @@ else
readline_dir=""
readline_link="-lreadline"
fi
+fi
AC_SUBST(readline_dir)
AC_SUBST(readline_link)
@@ -2031,6 +2194,13 @@ AC_ARG_WITH(extra-charsets,
[extra_charsets="$withval"],
[extra_charsets="none"])
+AC_ARG_WITH(platform-dir,
+ [ --with-platform-dir=DIR
+ Add specified directory to list of SUBDIRS to build.],
+ [ with_platform_dir=$withval ],
+ [ with_platform_dir=no ]
+ )
+
AC_MSG_CHECKING("character sets")
if test "$extra_charsets" = none; then
@@ -2269,11 +2439,18 @@ AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs)
AC_SUBST(linked_client_targets)
+platform_dir=
+if test "$with_platform_dir" != "no"
+then
+ platform_dir="$with_platform_dir"
+fi
+AC_SUBST(platform_dir)
+
if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
then
AC_DEFINE(THREAD)
# Avoid _PROGRAMS names
- THREAD_LPROGRAMS="test_thr_alarm test_thr_lock"
+ THREAD_LPROGRAMS="test_thr_alarm\$(EXEEXT) test_thr_lock\$(EXEEXT)"
AC_SUBST(THREAD_LPROGRAMS)
THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o"
AC_SUBST(THREAD_LOBJECTS)
@@ -2377,7 +2554,7 @@ EOF
then
innodb_conf_flags=--disable-dependency-tracking
fi
- (cd innobase && sh $rel_srcdir/innobase/configure $innodb_conf_flags) \
+ (cd innobase && sh $rel_srcdir/innobase/configure --host=$host $innodb_conf_flags) \
|| AC_MSG_ERROR([could not configure INNODB])
echo "END OF INNODB CONFIGURATION"
@@ -2435,20 +2612,21 @@ AC_SUBST(GXX)
#AC_SUBST(TOOLS_LIBS)
# Output results
-AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \
- strings/Makefile regex/Makefile heap/Makefile \
- bdb/Makefile \
- myisam/Makefile myisammrg/Makefile \
- os2/Makefile os2/include/Makefile os2/include/sys/Makefile \
- man/Makefile BUILD/Makefile readline/Makefile vio/Makefile \
- libmysql_r/Makefile libmysqld/Makefile libmysqld/examples/Makefile \
- libmysql/Makefile client/Makefile \
- pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile \
- merge/Makefile dbug/Makefile scripts/Makefile \
- include/Makefile sql-bench/Makefile tools/Makefile \
- tests/Makefile Docs/Makefile support-files/Makefile \
- mysql-test/Makefile \
- include/mysql_version.h
+AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
+ strings/Makefile regex/Makefile heap/Makefile dnl
+ bdb/Makefile dnl
+ myisam/Makefile myisammrg/Makefile dnl
+ os2/Makefile os2/include/Makefile os2/include/sys/Makefile dnl
+ man/Makefile BUILD/Makefile readline/Makefile vio/Makefile dnl
+ libmysql_r/Makefile libmysqld/Makefile libmysqld/examples/Makefile dnl
+ libmysql/Makefile client/Makefile dnl
+ pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl
+ merge/Makefile dbug/Makefile scripts/Makefile dnl
+ include/Makefile sql-bench/Makefile tools/Makefile dnl
+ tests/Makefile Docs/Makefile support-files/Makefile dnl
+ mysql-test/Makefile dnl
+ netware/Makefile dnl
+ include/mysql_version.h dnl
, , [
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
])
diff --git a/extra/resolveip.c b/extra/resolveip.c
index e380d920e9f..52d71d40a64 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -16,7 +16,7 @@
/* Resolves IP's to hostname and hostnames to IP's */
-#define RESOLVE_VERSION "2.2"
+#define RESOLVE_VERSION "2.3"
#include <my_global.h>
#include <m_ctype.h>
@@ -147,8 +147,11 @@ int main(int argc, char **argv)
else
{
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++)
(void) printf(", %s", *q);
+#endif /* __NETWARE__ */
puts("");
}
}
diff --git a/include/Makefile.am b/include/Makefile.am
index 077ec3c9017..7a02b38020d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,7 +22,7 @@ pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h \
errmsg.h my_global.h my_net.h my_alloc.h \
my_getopt.h sslopt-longopts.h \
sslopt-vars.h sslopt-case.h $(BUILT_SOURCES)
-noinst_HEADERS = config-win.h config-os2.h \
+noinst_HEADERS = config-win.h config-os2.h config-netware.h \
nisam.h heap.h merge.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\
my_dir.h mysys_err.h my_base.h \
diff --git a/include/config-netware.h b/include/config-netware.h
new file mode 100644
index 00000000000..57bf500da47
--- /dev/null
+++ b/include/config-netware.h
@@ -0,0 +1,86 @@
+/* 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; 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 */
+
+/* Defines for netware compatible with MySQL */
+
+/* required headers */
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+#include <screen.h>
+#include <limits.h>
+#include <nks/synch.h>
+#include <nks/thread.h>
+#include <signal.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <nks/errno.h>
+#include <sys/types.h>
+#include <time.h>
+#include <sys/time.h>
+#include <nks/time.h>
+#include <pthread.h>
+#include <termios.h>
+
+/* 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_CRYPT
+#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
+#define HAVE_PTHREAD_SIGMASK 1
+#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
+#define HAVE_BROKEN_REALPATH 1
+
+/* no case sensitivity */
+#define FN_NO_CASE_SENCE 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
+
+/* 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 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=(SEC); (ABSTIME).tv_nsec=0; }
diff --git a/include/config-win.h b/include/config-win.h
index 5bdede86a9e..b4b9a59a067 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -182,6 +182,8 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#endif
+#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
+
#define STACK_DIRECTION -1
/* Optimized store functions for Intel x86 */
@@ -276,6 +278,7 @@ inline double ulonglong2double(ulonglong value)
#define my_reinterpret_cast(A) reinterpret_cast <A>
#define my_const_cast(A) const_cast<A>
+
/* MYSQL OPTIONS */
#ifdef _CUSTOMCONFIG_
diff --git a/include/my_global.h b/include/my_global.h
index 3b66b3cbc16..a360947e42d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -51,6 +51,12 @@
#include <config-win.h>
#elif defined(OS2)
#include <config-os2.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)
@@ -442,17 +448,20 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* file create flags */
-#ifndef O_SHARE
+#ifndef O_SHARE /* Probably not windows */
#define O_SHARE 0 /* Flag to my_open for shared files */
#ifndef O_BINARY
#define O_BINARY 0 /* Flag to my_open for binary files */
#endif
-#define FILE_BINARY 0 /* Flag to my_fopen for binary streams */
+#ifndef FILE_BINARY
+#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */
+#endif
#ifdef HAVE_FCNTL
#define HAVE_FCNTL_LOCK
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
#endif
#endif /* O_SHARE */
+
#ifndef O_TEMPORARY
#define O_TEMPORARY 0
#endif
@@ -795,10 +804,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
+#ifndef set_timespec
#ifdef HAVE_TIMESPEC_TS_SEC
#define set_timespec(ABSTIME,SEC) { (ABSTIME).ts_sec=time(0) + (time_t) (SEC); (ABSTIME).ts_nsec=0; }
-#elif defined(__WIN__)
-#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
#else
#define set_timespec(ABSTIME,SEC) \
{\
@@ -807,7 +815,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
-#endif
+#endif /* HAVE_TIMESPEC_TS_SEC */
+#endif /* set_timespec */
/*
Define-funktions for reading and storing in machine independent format
diff --git a/include/my_net.h b/include/my_net.h
index ec985ded76b..28d862d8528 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -44,7 +44,7 @@ C_MODE_START
#include <sys/ioctl.h>
#endif
-#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
+#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__NETWARE__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
diff --git a/include/my_pthread.h b/include/my_pthread.h
index e0394bc978a..bea6b8bef5a 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -356,6 +356,14 @@ extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
#endif
+
+#ifdef __NETWARE__
+extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
+ pthread_mutex_t *mutex,
+ struct timespec *abstime);
+#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
+#endif /* __NETWARE__ */
+
#if defined(OS2)
#define my_pthread_getspecific(T,A) ((T) &(A))
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
@@ -443,15 +451,39 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
/* 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
{
pthread_mutex_t global,mutex;
char *file;
uint line,count;
pthread_t thread;
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+ struct st_safe_mutex_info_t *info; /* to track destroying of mutexes */
+#endif
} safe_mutex_t;
-int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr);
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+/*
+ Used to track the destroying of mutexes. This needs to be a seperate
+ structure because the safe_mutex_t structure could be freed before
+ the mutexes are destroyed.
+*/
+
+typedef struct st_safe_mutex_info_t
+{
+ struct st_safe_mutex_info_t *next;
+ struct st_safe_mutex_info_t *prev;
+ char *init_file;
+ uint32 init_line;
+} safe_mutex_info_t;
+#endif /* SAFE_MUTEX_DETECT_DESTROY */
+
+int safe_mutex_init(safe_mutex_t *mp, const pthread_mutexattr_t *attr,
+ const char *file, uint line);
int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_unlock(safe_mutex_t *mp,const char *file, uint line);
int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line);
@@ -459,6 +491,8 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file,
uint line);
int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
struct timespec *abstime, const char *file, uint line);
+void safe_mutex_global_init(void);
+void safe_mutex_end(FILE *file);
/* Wrappers if safe mutex is actually used */
#ifdef SAFE_MUTEX
@@ -472,7 +506,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
#undef pthread_cond_wait
#undef pthread_cond_timedwait
#undef pthread_mutex_trylock
-#define pthread_mutex_init(A,B) safe_mutex_init((A),(B))
+#define pthread_mutex_init(A,B) safe_mutex_init((A),(B),__FILE__,__LINE__)
#define pthread_mutex_lock(A) safe_mutex_lock((A),__FILE__,__LINE__)
#define pthread_mutex_unlock(A) safe_mutex_unlock((A),__FILE__,__LINE__)
#define pthread_mutex_destroy(A) safe_mutex_destroy((A),__FILE__,__LINE__)
diff --git a/include/my_sys.h b/include/my_sys.h
index e873f2012b7..914effe8ea7 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -731,29 +731,32 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_free_lock(A,B) my_free((A),(B))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
-void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size);
-gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
-void free_root(MEM_ROOT *root, myf MyFLAGS);
-void set_prealloc_root(MEM_ROOT *root, char *ptr);
-char *strdup_root(MEM_ROOT *root,const char *str);
-char *strmake_root(MEM_ROOT *root,const char *str,uint len);
-char *memdup_root(MEM_ROOT *root,const char *str,uint len);
-void load_defaults(const char *conf_file, const char **groups,
- int *argc, char ***argv);
-void free_defaults(char **argv);
-void print_defaults(const char *conf_file, const char **groups);
-my_bool my_compress(byte *, ulong *, ulong *);
-my_bool my_uncompress(byte *, ulong *, ulong *);
-byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
-ulong checksum(const byte *mem, uint count);
-uint my_bit_log2(ulong value);
-
-#if defined(_MSC_VER) && !defined(__WIN__)
-extern void sleep(int sec);
-#endif
+extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
+ uint pre_alloc_size);
+extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
+extern void free_root(MEM_ROOT *root, myf MyFLAGS);
+extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
+extern char *strdup_root(MEM_ROOT *root,const char *str);
+extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
+extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
+extern void load_defaults(const char *conf_file, const char **groups,
+ int *argc, char ***argv);
+extern void free_defaults(char **argv);
+extern void print_defaults(const char *conf_file, const char **groups);
+extern my_bool my_compress(byte *, ulong *, ulong *);
+extern my_bool my_uncompress(byte *, ulong *, ulong *);
+extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
+extern ulong checksum(const byte *mem, uint count);
+extern uint my_bit_log2(ulong value);
+extern void my_sleep(ulong m_seconds);
+
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */
#endif
+#ifdef __NETWARE__
+void netware_reg_user(const char *ip, const char *user,
+ const char *application);
+#endif
C_MODE_END
#include "raid.h"
diff --git a/include/mysql.h b/include/mysql.h
index 8d497720a23..486caa5baa5 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -60,6 +60,10 @@ typedef int my_socket;
extern unsigned int mysql_port;
extern char *mysql_unix_port;
+#ifdef __NETWARE__
+#pragma pack(push, 8) /* 8 byte alignment */
+#endif
+
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
@@ -418,6 +422,11 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
int simple_command(MYSQL *mysql,enum enum_server_command command,
const char *arg, unsigned long length, my_bool skipp_check);
unsigned long net_safe_read(MYSQL* mysql);
+void STDCALL mysql_once_init(void);
+
+#ifdef __NETWARE__
+#pragma pack(pop) /* restore alignment */
+#endif
#ifdef __cplusplus
}
diff --git a/innobase/configure.in b/innobase/configure.in
index 59d213fef12..29309a2c0a5 100644
--- a/innobase/configure.in
+++ b/innobase/configure.in
@@ -110,14 +110,14 @@ case "$target" in
CFLAGS="$CFLAGS -DUNIV_INTEL_X86";;
esac
-AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile
- buf/Makefile com/Makefile data/Makefile
- dict/Makefile dyn/Makefile
- eval/Makefile fil/Makefile fsp/Makefile fut/Makefile
- ha/Makefile ibuf/Makefile include/Makefile
- lock/Makefile log/Makefile
- mach/Makefile mem/Makefile mtr/Makefile odbc/Makefile
- page/Makefile pars/Makefile que/Makefile
- read/Makefile rem/Makefile row/Makefile
- srv/Makefile sync/Makefile thr/Makefile trx/Makefile
+AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl
+ buf/Makefile com/Makefile data/Makefile dnl
+ dict/Makefile dyn/Makefile dnl
+ eval/Makefile fil/Makefile fsp/Makefile fut/Makefile dnl
+ ha/Makefile ibuf/Makefile include/Makefile dnl
+ lock/Makefile log/Makefile dnl
+ mach/Makefile mem/Makefile mtr/Makefile odbc/Makefile dnl
+ page/Makefile pars/Makefile que/Makefile dnl
+ read/Makefile rem/Makefile row/Makefile dnl
+ srv/Makefile sync/Makefile thr/Makefile trx/Makefile dnl
usr/Makefile)
diff --git a/innobase/include/os0thread.h b/innobase/include/os0thread.h
index efc8651e06d..629cfef23a8 100644
--- a/innobase/include/os0thread.h
+++ b/innobase/include/os0thread.h
@@ -15,9 +15,10 @@ Created 9/8/1995 Heikki Tuuri
/* Maximum number of threads which can be created in the program;
this is also the size of the wait slot array for MySQL threads which
can wait inside InnoDB */
-#ifdef __WIN__
+#if defined(__WIN__) || defined(__NETWARE__)
/* Create less event semaphores because Win 98/ME had difficult creating
40000 event semaphores */
+/* TODO: these just take a lot of memory on NetWare. should netware move up? */
#define OS_THREAD_MAX_N 1000
#else
#define OS_THREAD_MAX_N 10000
diff --git a/innobase/os/os0sync.c b/innobase/os/os0sync.c
index bac1f23a1af..a9127e6310a 100644
--- a/innobase/os/os0sync.c
+++ b/innobase/os/os0sync.c
@@ -495,6 +495,8 @@ os_fast_mutex_free(
ut_a(fast_mutex);
DeleteCriticalSection((LPCRITICAL_SECTION) fast_mutex);
+#elif defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+ pthread_mutex_destroy(fast_mutex);
#else
UT_NOT_USED(fast_mutex);
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c
index 30404c4e66b..b0076921e43 100644
--- a/innobase/os/os0thread.c
+++ b/innobase/os/os0thread.c
@@ -214,6 +214,8 @@ os_thread_sleep(
{
#ifdef __WIN__
Sleep(tm / 1000);
+#elif defined(__NETWARE__)
+ delay(tm / 1000);
#else
struct timeval t;
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 61f5a847d51..c6f3bd40dfe 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1700,8 +1700,63 @@ srv_general_init(void)
thr_local_init();
}
+
+#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+/* NetWare requires some cleanup of mutexes */
+
+/*************************************************************************
+Deinitializes the synchronization primitives, memory system, and the thread
+local storage. */
+
+void
+srv_general_free(void)
+/*==================*/
+{
+ sync_close();
+}
+#endif /* __NETWARE__ */
+
+
/*======================= InnoDB Server FIFO queue =======================*/
+#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+/* NetWare requires some cleanup of mutexes */
+
+/*************************************************************************
+Deinitializes the server. */
+
+void
+srv_free(void)
+/*==========*/
+{
+ srv_conc_slot_t* conc_slot;
+ srv_slot_t* slot;
+ ulint i;
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++)
+ {
+ slot = srv_table_get_nth_slot(i);
+ os_event_free(slot->event);
+ }
+
+ /* TODO: free(srv_sys->threads); */
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++)
+ {
+ slot = srv_mysql_table + i;
+ os_event_free(slot->event);
+ }
+
+ /* TODO: free(srv_mysql_table); */
+
+ for (i = 0; i < OS_THREAD_MAX_N; i++)
+ {
+ conc_slot = srv_conc_slots + i;
+ os_event_free(conc_slot->event);
+ }
+}
+#endif /* __NETWARE__ */
+
/*************************************************************************
Puts an OS thread to wait if there are too many concurrent threads
(>= srv_thread_concurrency) inside InnoDB. The threads wait in a FIFO queue. */
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index ec674b69256..65284d51b04 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1415,6 +1415,10 @@ innobase_start_or_create_for_mysql(void)
os_fast_mutex_unlock(&srv_os_test_mutex);
+#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+ os_fast_mutex_free(&srv_os_test_mutex); /* all platforms? */
+#endif /* __NETWARE__ */
+
if (srv_print_verbose_log) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Started\n");
@@ -1461,12 +1465,28 @@ innobase_shutdown_for_mysql(void)
srv_conc_n_threads);
}
+#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+ /*
+ TODO: Fix this temporary solution
+ We are having a race condition occure with io_handler_thread threads.
+ When they yield in os_aio_simulated_handle during shutdown, this
+ thread was able to free the memory early.
+ */
+ os_thread_yield();
+
+ /* TODO: Where should this be called? */
+ srv_free();
+
+ /* TODO: Where should this be called? */
+ srv_general_free();
+#endif
/*
TODO: We should exit the i/o-handler and other utility threads
before freeing all memory. Now this can potentially cause a seg
fault!
*/
-#ifdef NOT_WORKING_YET
+#if defined(NOT_WORKING_YET) || defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
+ /* NetWare requires this free */
ut_free_all_mem();
#endif
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 376be2e723a..20d68ba5a9f 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -220,7 +220,7 @@ mutex_create_func(
char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
-#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
+#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) && !defined(__NETWARE)
mutex_reset_lock_word(mutex);
#else
os_fast_mutex_init(&(mutex->os_fast_mutex));
diff --git a/isam/test3.c b/isam/test3.c
index 7027c56d0f6..228030f5832 100644
--- a/isam/test3.c
+++ b/isam/test3.c
@@ -16,6 +16,8 @@
/* Test av locking */
+#ifndef __NETWARE__
+
#include "nisam.h"
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
@@ -477,3 +479,15 @@ int test_update(N_INFO *file,int id,int lock_type)
printf("%2d: update: %5d\n",id,update); fflush(stdout);
return 0;
}
+
+#else /* __NETWARE__ */
+
+#include <stdio.h>
+
+main()
+{
+ fprintf(stderr,"this test has not been ported to NetWare\n");
+ return 0;
+}
+
+#endif /* __NETWARE__ */
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 2bcf95f467d..9f4b3e9ccdd 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -58,7 +58,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
thr_mutex.lo mulalloc.lo string.lo default.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo hash.lo mf_iocache.lo \
- mf_iocache2.lo my_seek.lo \
+ mf_iocache2.lo my_seek.lo my_sleep.lo \
my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo \
my_getopt.lo my_gethostbyname.lo my_port.lo
sqlobjects = net.lo
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index 124c315a821..53eeb1080ce 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -34,7 +34,7 @@
#include <pwd.h>
#endif /* HAVE_PWD_H */
#else /* ! HAVE_GETPASS */
-#if !defined( __WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
#include <sys/ioctl.h>
#ifdef HAVE_TERMIOS_H /* For tty-password */
#include <termios.h>
@@ -53,7 +53,9 @@
#include <asm/termiobits.h>
#endif
#else
+#ifndef __NETWARE__
#include <conio.h>
+#endif /* __NETWARE__ */
#endif /* __WIN__ */
#endif /* HAVE_GETPASS */
@@ -61,9 +63,16 @@
#define getpass(A) getpassphrase(A)
#endif
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
/* 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(char *opt_message)
{
char to[80];
@@ -100,12 +109,11 @@ char *get_tty_password(char *opt_message)
#else
-
#ifndef HAVE_GETPASS
/*
-** Can't use fgets, because readline will get confused
-** length is max number of chars in to, not counting \0
-* to will not include the eol characters.
+ Can't use fgets, because readline will get confused
+ length is max number of chars in to, not counting \0
+ to will not include the eol characters.
*/
static void get_password(char *to,uint length,int fd,bool echo)
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 130e6b1556a..45dde457fd5 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -73,14 +73,13 @@ ulong net_write_timeout= NET_WRITE_TIMEOUT;
#endif
#if defined(MSDOS) || defined(__WIN__)
-// socket_errno is defined in my_global.h for all platforms
+/* socket_errno is defined in my_global.h for all platforms */
#define perror(A)
#else
#include <errno.h>
#define SOCKET_ERROR -1
#endif /* __WIN__ */
-static void mysql_once_init(void);
static MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields,
uint field_count);
static int read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row,
@@ -100,6 +99,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
char **argv __attribute__((unused)),
char **groups __attribute__((unused)))
{
+ mysql_once_init();
return 0;
}
@@ -108,6 +108,8 @@ void STDCALL mysql_server_end()
/* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
my_end(0);
+ else
+ mysql_thread_end();
}
my_bool STDCALL mysql_thread_init()
@@ -159,7 +161,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
int my_connect(my_socket s, const struct sockaddr *name, uint namelen,
uint timeout)
{
-#if defined(__WIN__) || defined(OS2)
+#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
return connect(s, (struct sockaddr*) name, namelen);
#else
int flags, res, s_err;
@@ -528,7 +530,16 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
-#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2)
+
+#if defined(__NETWARE__)
+/* default to "root" on NetWare */
+static void read_user_name(char *name)
+{
+ (void)strmake(name,"root", USERNAME_LENGTH);
+}
+
+#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2)
+
static void read_user_name(char *name)
{
DBUG_ENTER("read_user_name");
@@ -1402,7 +1413,20 @@ mysql_init(MYSQL *mysql)
}
-static void mysql_once_init()
+/*
+ Initialize the MySQL library
+
+ SYNOPSIS
+ mysql_once_init()
+
+ NOTES
+ Can't be static on NetWare
+ This function is called by mysql_init() and indirectly called
+ by mysql_query(), so one should never have to call this from an
+ outside program.
+*/
+
+void STDCALL mysql_once_init(void)
{
if (!mysql_client_init)
{
diff --git a/libmysql/manager.c b/libmysql/manager.c
index 22b109caea8..d4bd8d5520b 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -34,6 +34,10 @@
#if defined(OS2)
# include <sys/un.h>
+#elif defined(__NETWARE__)
+#include <netdb.h>
+#include <sys/select.h>
+#include <sys/utsname.h>
#elif !defined( __WIN__)
#include <sys/resource.h>
#ifdef HAVE_SYS_UN_H
diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c
index ac36f55a181..6111167b38f 100644
--- a/myisam/mi_test3.c
+++ b/myisam/mi_test3.c
@@ -16,6 +16,8 @@
/* Test av locking */
+#ifndef __NETWARE__
+
#include "myisam.h"
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
@@ -483,3 +485,15 @@ int test_update(MI_INFO *file,int id,int lock_type)
printf("%2d: update: %5d\n",id,update); fflush(stdout);
return 0;
}
+
+#else /* __NETWARE__ */
+
+#include <stdio.h>
+
+main()
+{
+ fprintf(stderr,"this test has not been ported to NetWare\n");
+ return 0;
+}
+
+#endif /* __NETWARE__ */
diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc
new file mode 100644
index 00000000000..fe1f974bffd
--- /dev/null
+++ b/mysql-test/include/have_crypt.inc
@@ -0,0 +1,4 @@
+-- require r/have_crypt.require
+disable_query_log;
+show variables like "have_crypt";
+enable_query_log;
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index a7292ee5eec..0f12dd9122a 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -106,6 +106,7 @@ TAIL=tail
ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible
FIND=find
+GREP=grep
if test $? != 0; then exit 1; fi
PRINTF=printf
RM=rm
@@ -605,6 +606,30 @@ report_stats () {
$ECHO "If you want to report this error, please read first the documentation at"
$ECHO "http://www.mysql.com/doc/M/y/MySQL_test_suite.html"
fi
+
+ #
+ # Report if there was any fatal warnings/errors in the log files
+ #
+ $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
+ # Remove some non fatal warnings from the log files
+ $SED -e 's!Warning: Table:.* on delete!!g' \
+ $MY_LOG_DIR/*.err > $MY_LOG_DIR/warnings.tmp
+
+ found_error=0
+ # Find errors
+ for i in "^Warning:" "^Error:" "^==.* at 0x"
+ do
+ if `$GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings`
+ then
+ found_error=1
+ fi
+ done
+ $RM -f $MY_LOG_DIR/warnings.tmp
+ if [ $found_error = "1" ]
+ then
+ echo "WARNING: Got errors/warnings while running tests. Please examine"
+ echo "$MY_LOG_DIR/warnings for details."
+ fi
}
mysql_install_db () {
diff --git a/mysql-test/r/count_distinct.result b/mysql-test/r/count_distinct.result
index 3bff6c6ad88..81976d268ef 100644
--- a/mysql-test/r/count_distinct.result
+++ b/mysql-test/r/count_distinct.result
@@ -36,6 +36,10 @@ select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join
isbn city libname a
007 Berkeley Berkeley Public1 2
000 New York New York Public Libra 2
+select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1;
+isbn city libname a
+007 Berkeley Berkeley Public1 2
+000 New York New York Public Libra 2
drop table t1, t2, t3;
create table t1 (f1 int);
insert into t1 values (1);
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 02773f2eb44..35867cf6532 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -32,6 +32,11 @@ userid MIN(t1.score)
1 1
2 2
3 3
+SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL;
+userid MIN(t1.score)
+1 1
+2 2
+3 3
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
userid MIN(t1.score)
1 1
@@ -40,6 +45,10 @@ SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1
userid MIN(t1.score+0.0)
1 1.0
2 2.0
+SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
+userid MIN(t1.score+0.0)
+1 1.0
+2 2.0
drop table test.t1,test.t2;
CREATE TABLE t1 (
PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
@@ -86,6 +95,8 @@ INSERT INTO t2 VALUES (91,2);
INSERT INTO t2 VALUES (92,2);
SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid;
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
+SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL;
+cid CONCAT(firstname, ' ', surname) COUNT(call_id)
SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
drop table t1,t2;
@@ -235,6 +246,9 @@ INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3);
explain select userid,count(*) from t1 group by userid desc;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+explain select userid,count(*) from t1 group by userid desc order by null;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 6 Using temporary
select userid,count(*) from t1 group by userid desc;
userid count(*)
3 3
@@ -253,6 +267,9 @@ t1 range spID spID 5 NULL 2 Using where; Using index
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
table type possible_keys key key_len ref rows Extra
t1 range spID spID 5 NULL 2 Using where; Using index
+explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null;
+table type possible_keys key key_len ref rows Extra
+t1 range spID spID 5 NULL 2 Using where; Using index
select spid,count(*) from t1 where spid between 1 and 2 group by spid;
spid count(*)
1 1
@@ -264,6 +281,9 @@ spid count(*)
explain select sql_big_result spid,sum(userid) from t1 group by spid desc;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 6 Using filesort
+explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 6
select sql_big_result spid,sum(userid) from t1 group by spid desc;
spid sum(userid)
5 3
@@ -274,6 +294,9 @@ spid sum(userid)
explain select sql_big_result score,count(*) from t1 group by score desc;
table type possible_keys key key_len ref rows Extra
t1 index NULL score 3 NULL 6 Using index
+explain select sql_big_result score,count(*) from t1 group by score desc order by null;
+table type possible_keys key key_len ref rows Extra
+t1 index NULL score 3 NULL 6 Using index
select sql_big_result score,count(*) from t1 group by score desc;
score count(*)
3 3
@@ -481,3 +504,28 @@ NULL 9
3
b 1
drop table t1;
+create table t1 (a int not null, b int not null);
+insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1);
+create table t2 (a int not null, b int not null, key(a));
+insert into t2 values (1,3),(3,1),(2,2),(1,1);
+select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
+a b
+1 1
+1 3
+2 2
+3 1
+select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
+a b
+1 3
+3 1
+2 2
+1 1
+explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+t2 ALL a NULL NULL NULL 4 Using where
+explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 6 Using temporary
+t2 ALL a NULL NULL NULL 4 Using where
+drop table t1,t2;
diff --git a/mysql-test/r/have_crypt.require b/mysql-test/r/have_crypt.require
new file mode 100644
index 00000000000..739fbb738f0
--- /dev/null
+++ b/mysql-test/r/have_crypt.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_crypt YES
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index ad332cde646..55fe140850d 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -4,7 +4,7 @@ connection con1;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1(n int);
---replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X"
+--replace_result "errno = 1" "errno = X" "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X"
backup table t1 to '../bogus';
backup table t1 to '../tmp';
drop table t1;
diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test
index 3d795d44821..f3584686f69 100644
--- a/mysql-test/t/count_distinct.test
+++ b/mysql-test/t/count_distinct.test
@@ -31,6 +31,7 @@ insert into t1 values ('Berkeley Public2','Berkeley');
insert into t1 values ('NYC Lib','New York');
select t2.isbn,city,t1.libname,count(t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city,t1.libname;
select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct t1.libname) > 1;
+select t2.isbn,city,t1.libname,count(distinct t1.libname) as a from t3 left join t1 on t3.libname=t1.libname left join t2 on t3.isbn=t2.isbn group by city having count(distinct concat(t1.libname,'a')) > 1;
drop table t1, t2, t3;
#
diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test
index f01504d3691..55c0d6d3b9d 100644
--- a/mysql-test/t/func_crypt.test
+++ b/mysql-test/t/func_crypt.test
@@ -1,3 +1,5 @@
+-- source include/have_crypt.inc
+
select length(encrypt('foo', 'ff')) <> 0;
--replace_result $1$aa$4OSUA5cjdx0RUQ08opV27/ aaqPiZY5xR5l.
select password('test'),length(encrypt('test')),encrypt('test','aa');
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index 09ce1021fbf..7dfbb3b8d83 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -6,7 +6,7 @@
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
reset query cache;
flush status;
-connect (root,localhost,root,,test,0,master.sock);
+connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
connection root;
create database if not exists mysqltest;
@@ -17,7 +17,7 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
-connect (root2,localhost,root,,mysqltest,0,master.sock);
+connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,master.sock);
connection root2;
# put queries in cache
select * from t1;
@@ -35,7 +35,7 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
-connect (user1,localhost,mysqltest_1,,mysqltest,0,master.sock);
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
connection user1;
select "user1";
select * from t1;
@@ -47,13 +47,14 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should be fetched from cache
-connect (user2,localhost,mysqltest_2,,mysqltest,0,master.sock);
+connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock);
connection user2;
select "user2";
select * from t1;
select a from t1;
select c from t1;
select * from mysqltest.t1,test.t1;
+--replace_result 127.0.0.1 localhost
--error 1142
select * from t2;
show status like "Qcache_queries_in_cache";
@@ -61,16 +62,20 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should not be fetched from cache
-connect (user3,localhost,mysqltest_3,,mysqltest,0,master.sock);
+connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,master.sock);
connection user3;
select "user3";
+--replace_result 127.0.0.1 localhost
--error 1143
select * from t1;
select a from t1;
+--replace_result 127.0.0.1 localhost
--error 1143
select c from t1;
+--replace_result 127.0.0.1 localhost
--error 1142
select * from t2;
+--replace_result 127.0.0.1 localhost
--error 1143
select mysqltest.t1.c from test.t1,mysqltest.t1;
show status like "Qcache_queries_in_cache";
@@ -78,7 +83,7 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Connect without a database
-connect (user4,localhost,mysqltest_1,,*NO-ONE*,0,master.sock);
+connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
connection user4;
select "user4";
--error 1046
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index bc01577c249..98b1ee238b1 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -36,8 +36,10 @@ INSERT INTO t2 VALUES (2,'name','pass','mail','Y','v','n','adr','1','1','1');
INSERT INTO t2 VALUES (3,'name','pass','mail','Y','v','n','adr','1','1','1');
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid;
+SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID GROUP BY t2.userid ORDER BY NULL;
SELECT t2.userid, MIN(t1.score) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid;
+SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1.spID=2 GROUP BY t2.userid ORDER BY NULL;
drop table test.t1,test.t2;
#
@@ -100,6 +102,7 @@ INSERT INTO t2 VALUES (91,2);
INSERT INTO t2 VALUES (92,2);
SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid;
+SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY NULL;
SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
drop table t1,t2;
@@ -234,16 +237,20 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1,1,1),(2,2,2),(2,1,1),(3,3,3),(4,3,3),(5,3,3);
explain select userid,count(*) from t1 group by userid desc;
+explain select userid,count(*) from t1 group by userid desc order by null;
select userid,count(*) from t1 group by userid desc;
select userid,count(*) from t1 group by userid desc having (count(*)+1) IN (4,3);
select userid,count(*) from t1 group by userid desc having 3 IN (1,COUNT(*));
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
explain select spid,count(*) from t1 where spid between 1 and 2 group by spid;
+explain select spid,count(*) from t1 where spid between 1 and 2 group by spid order by null;
select spid,count(*) from t1 where spid between 1 and 2 group by spid;
select spid,count(*) from t1 where spid between 1 and 2 group by spid desc;
explain select sql_big_result spid,sum(userid) from t1 group by spid desc;
+explain select sql_big_result spid,sum(userid) from t1 group by spid desc order by null;
select sql_big_result spid,sum(userid) from t1 group by spid desc;
explain select sql_big_result score,count(*) from t1 group by score desc;
+explain select sql_big_result score,count(*) from t1 group by score desc order by null;
select sql_big_result score,count(*) from t1 group by score desc;
drop table t1;
@@ -365,3 +372,17 @@ select a,count(*) from t1 group by a;
set option sql_big_tables=1;
select a,count(*) from t1 group by a;
drop table t1;
+
+#
+# Test of GROUP BY ... ORDER BY NULL optimization
+#
+
+create table t1 (a int not null, b int not null);
+insert into t1 values (1,1),(1,2),(3,1),(3,2),(2,2),(2,1);
+create table t2 (a int not null, b int not null, key(a));
+insert into t2 values (1,3),(3,1),(2,2),(1,1);
+select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
+select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
+explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
+explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
+drop table t1,t2;
diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test
index c42e14699c5..26d32ea3e11 100644
--- a/mysql-test/t/rpl000015.test
+++ b/mysql-test/t/rpl000015.test
@@ -1,5 +1,5 @@
-connect (master,localhost,root,,test,0,master.sock);
-connect (slave,localhost,root,,test,0, slave.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
connection master;
reset master;
show master status;
diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test
index f346ca39ca0..d4f41f1e374 100644
--- a/mysql-test/t/rpl000017.test
+++ b/mysql-test/t/rpl000017.test
@@ -1,5 +1,5 @@
-connect (master,localhost,root,,test,0,master.sock);
-connect (slave,localhost,root,,test,0,slave.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
connection master;
reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test
index a9bb98932ed..6edbf363b1a 100644
--- a/mysql-test/t/rpl_rotate_logs.test
+++ b/mysql-test/t/rpl_rotate_logs.test
@@ -9,9 +9,9 @@
# changes
# - Test creating a duplicate key error and recover from it
#
-connect (master,localhost,root,,test,0,master.sock);
+connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock);
drop table if exists t1, t2, t3, t4;
-connect (slave,localhost,root,,test,0,slave.sock);
+connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
system cat /dev/null > var/slave-data/master.info;
system chmod 000 var/slave-data/master.info;
connection slave;
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 67bc8feadaa..a927fa5e3a0 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -49,9 +49,10 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
my_quick.c my_lockmem.c my_static.c \
my_getopt.c my_mkdir.c \
default.c my_compress.c checksum.c raid.cc \
- my_net.c my_semaphore.c my_port.c \
+ my_net.c my_semaphore.c my_port.c my_sleep.c \
my_vsnprintf.c charset.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_netware.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
@@ -77,32 +78,32 @@ FLAGS=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @NOINST_LDFLAGS@
# which automaticly removes the object files you use to compile a final program
#
-test_thr_alarm: thr_alarm.c $(LIBRARIES)
+test_thr_alarm$(EXEEXT): thr_alarm.c $(LIBRARIES)
$(CP) $(srcdir)/thr_alarm.c ./test_thr_alarm.c
$(LINK) $(FLAGS) -DMAIN ./test_thr_alarm.c $(LDADD) $(LIBS)
- $(RM) -f ./test_thr_alarm.*
+ $(RM) -f ./test_thr_alarm.c
-test_thr_lock: thr_lock.c $(LIBRARIES)
+test_thr_lock$(EXEEXT): thr_lock.c $(LIBRARIES)
$(CP) $(srcdir)/thr_lock.c test_thr_lock.c
$(LINK) $(FLAGS) -DMAIN ./test_thr_lock.c $(LDADD) $(LIBS)
- $(RM) -f ./test_thr_lock.*
+ $(RM) -f ./test_thr_lock.c
-test_vsnprintf: my_vsnprintf.c $(LIBRARIES)
+test_vsnprintf$(EXEEXT): my_vsnprintf.c $(LIBRARIES)
$(CP) $(srcdir)/my_vsnprintf.c test_vsnprintf.c
$(LINK) $(FLAGS) -DMAIN ./test_vsnprintf.c $(LDADD) $(LIBS)
- $(RM) -f test_vsnprintf.*
-test_io_cache: mf_iocache.c $(LIBRARIES)
+ $(RM) -f test_vsnprintf.c
+test_io_cache$(EXEEXT): mf_iocache.c $(LIBRARIES)
$(CP) $(srcdir)/mf_iocache.c test_io_cache.c
$(LINK) $(FLAGS) -DMAIN ./test_io_cache.c $(LDADD) $(LIBS)
- $(RM) -f test_io_cache.*
+ $(RM) -f test_io_cache.c
-test_dir: test_dir.c $(LIBRARIES)
+test_dir$(EXEEXT): test_dir.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
-testhash: testhash.c $(LIBRARIES)
+testhash$(EXEEXT): testhash.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
# Don't update the files from bitkeeper
diff --git a/mysys/charset.c b/mysys/charset.c
index 1001b76f417..235fcb08023 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -164,7 +164,11 @@ static my_bool read_charset_index(CS_ID ***charsets, myf myflags)
}
+#ifdef __NETWARE__
+my_bool STDCALL init_available_charsets(myf myflags)
+#else
static my_bool init_available_charsets(myf myflags)
+#endif
{
my_bool error=0;
/*
diff --git a/mysys/default.c b/mysys/default.c
index fdeeabf83eb..c354e1744bc 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -46,6 +46,8 @@ char *defaults_extra_file=0;
const char *default_directories[]= {
#ifdef __WIN__
"C:/",
+#elif defined(__NETWARE__)
+"sys:/etc/",
#else
"/etc/",
#endif
@@ -53,7 +55,7 @@ const char *default_directories[]= {
DATADIR,
#endif
"", /* Place for defaults_extra_dir */
-#ifndef __WIN__
+#if !defined(__WIN__) && !defined(__NETWARE__)
"~/",
#endif
NullS,
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 09fde27afd6..cca80dcd552 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -24,7 +24,7 @@
#endif
#ifdef HAVE_TEMPNAM
-#if !defined( MSDOS) && !defined(OS2)
+#if !defined(MSDOS) && !defined(OS2) && !defined(__NETWARE__)
extern char **environ;
#endif
#endif
@@ -129,7 +129,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
if (buffer[strlen(buffer)-1] == '\\')
buffer[strlen(buffer)-1] = '\0';
putenv( buffer);
-#else
+#elif !defined(__NETWARE__)
old_env= (char**) environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
@@ -151,7 +151,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
{
DBUG_PRINT("error",("Got error: %d from tempnam",errno));
}
-#ifndef OS2
+#if !defined(OS2) && !defined(__NETWARE__)
environ=(const char**) old_env;
#endif
}
diff --git a/mysys/my_clock.c b/mysys/my_clock.c
index e49b2f85b66..a192bde056d 100644
--- a/mysys/my_clock.c
+++ b/mysys/my_clock.c
@@ -17,14 +17,14 @@
#define USES_TYPES
#include "my_global.h"
-#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(OS2)
+#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(OS2) && !defined(__NETWARE__)
#include "mysys_priv.h"
#include <sys/times.h>
#endif
long my_clock(void)
{
-#if !defined(MSDOS) && !defined(__WIN__) && !defined(OS2)
+#if !defined(MSDOS) && !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
struct tms tmsbuf;
VOID(times(&tmsbuf));
return (tmsbuf.tms_utime + tmsbuf.tms_stime);
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index a899835ea62..012eaec4ea8 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -80,7 +80,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES && new_file_stat)
DBUG_RETURN(0); /* File copyed but not stat */
VOID(chmod(to, stat_buff.st_mode & 07777)); /* Copy modes */
-#if !defined(MSDOS) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
+#if !defined(MSDOS) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
VOID(chown(to, stat_buff.st_uid,stat_buff.st_gid)); /* Copy ownership */
#endif
#if !defined(VMS) && !defined(__ZTC__)
diff --git a/mysys/my_getwd.c b/mysys/my_getwd.c
index 22c6a4dbc2b..63ab17b4c51 100644
--- a/mysys/my_getwd.c
+++ b/mysys/my_getwd.c
@@ -32,7 +32,7 @@
#endif
#ifdef __EMX__
-// chdir2 support also drive change
+/* chdir2 support also drive change */
#define chdir _chdir2
#endif
diff --git a/mysys/my_init.c b/mysys/my_init.c
index f77cbc9846c..c6d590fc2aa 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -41,6 +41,12 @@ static my_bool win32_init_tcp_ip();
#else
#define my_win_init()
#endif
+#ifdef __NETWARE__
+static void netware_init();
+#else
+#define netware_init()
+#endif
+
my_bool my_init_done=0;
@@ -64,12 +70,16 @@ void my_init(void)
if (my_init_done)
return;
my_init_done=1;
+#if defined(THREAD) && defined(SAFE_MUTEX)
+ safe_mutex_global_init(); /* Must be called early */
+#endif
+ netware_init();
#ifdef THREAD
#if defined(HAVE_PTHREAD_INIT)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
my_thread_global_init();
-#if !defined( __WIN__) && !defined(OS2)
+#if !defined( __WIN__) && !defined(OS2) && !defined(__NETWARE__)
sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif
#endif /* THREAD */
@@ -143,7 +153,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals,
rus.ru_nvcsw, rus.ru_nivcsw);
#endif
-#if defined(MSDOS) && !defined(__WIN__)
+#if ( defined(MSDOS) || defined(__NETWARE__) ) && !defined(__WIN__)
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
#endif
#if defined(SAFEMALLOC)
@@ -160,21 +170,27 @@ Voluntary context switches %ld, Involuntary context switches %ld\n",
#endif
}
#ifdef THREAD
- pthread_mutex_destroy(&THR_LOCK_keycache);
- pthread_mutex_destroy(&THR_LOCK_malloc);
- pthread_mutex_destroy(&THR_LOCK_open);
DBUG_POP(); /* Must be done before my_thread_end */
my_once_free();
my_thread_end();
my_thread_global_end();
-#endif
+#if defined(SAFE_MUTEX)
+ /*
+ Check on destroying of mutexes. A few may be left that will get cleaned
+ up by C++ destructors
+ */
+ safe_mutex_end(infoflag & MY_GIVE_INFO ? stderr : (FILE *) 0);
+#endif /* defined(SAFE_MUTEX) */
+#endif /* THREAD */
+
#ifdef __WIN__
- if (have_tcpip);
- WSACleanup( );
+ if (have_tcpip)
+ WSACleanup();
#endif /* __WIN__ */
- my_init_done=0;
+ my_init_done=0;
} /* my_end */
+
#ifdef __WIN__
/*
@@ -263,10 +279,10 @@ static void my_win_init(void)
/*------------------------------------------------------------------
-** Name: CheckForTcpip| Desc: checks if tcpip has been installed on system
-** According to Microsoft Developers documentation the first registry
-** entry should be enough to check if TCP/IP is installed, but as expected
-** this doesn't work on all Win32 machines :(
+ Name: CheckForTcpip| Desc: checks if tcpip has been installed on system
+ According to Microsoft Developers documentation the first registry
+ entry should be enough to check if TCP/IP is installed, but as expected
+ this doesn't work on all Win32 machines :(
------------------------------------------------------------------*/
#define TCPIPKEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"
@@ -292,6 +308,7 @@ static my_bool win32_have_tcpip(void)
return (TRUE);
}
+
static my_bool win32_init_tcp_ip()
{
if (win32_have_tcpip())
@@ -323,4 +340,64 @@ static my_bool win32_init_tcp_ip()
}
return(0);
}
-#endif
+#endif /* __WIN__ */
+
+
+#ifdef __NETWARE__
+/****************************************************************************
+ Do basic initialisation for netware needed by most programs
+****************************************************************************/
+
+static void netware_init()
+{
+ char cwd[PATH_MAX], *name
+
+ /* 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= my_progname;
+ for (; *name; name++)
+ {
+ if (*name == '\\')
+ {
+ *name = '/';
+ }
+ else
+ {
+ *name = tolower(*name);
+ }
+ }
+ /*
+ Set the current working directory to the base directory of the file
+ name (assuming the binary is in 'base-file-name/bin/'
+ */
+ strmov(cwd, my_progname);
+ if ((name= strindex(cwd, "/bin/")) != NULL)
+ {
+ *name= 0;
+ chdir(cwd);
+ }
+ }
+}
+#endif /* __NETWARE__ */
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 44ac53677ba..5058c301adb 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -31,6 +31,9 @@
#define INCL_NOPMAPI
#include <os2emx.h>
#endif
+#ifdef __NETWARE__
+#include <nks/fsio.h>
+#endif
/* Lock a part of a file */
@@ -41,6 +44,9 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
int value;
ALARM_VARIABLES;
#endif
+#ifdef __NETWARE__
+ int nxErrno;
+#endif
DBUG_ENTER("my_lock");
DBUG_PRINT("my",("Fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
fd,locktype,(long) start,(long) length,MyFlags));
@@ -50,7 +56,47 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
if (my_disable_locking)
DBUG_RETURN(0);
-#if defined(__EMX__) || defined(OS2)
+#if defined(__NETWARE__)
+ {
+ 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(__EMX__) || defined(OS2)
if (!_lock64( fd, locktype, start, length, MyFlags))
DBUG_RETURN(0);
@@ -103,8 +149,12 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
#endif /* HAVE_FCNTL */
#endif /* HAVE_LOCKING */
+#ifdef __NETWARE__
+ my_errno = nxErrno;
+#else
/* We got an error. We don't want EACCES errors */
my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1;
+#endif
if (MyFlags & MY_WME)
{
if (locktype == F_UNLCK)
diff --git a/mysys/my_messnc.c b/mysys/my_messnc.c
index 6bb88443109..1f9df3c7c2c 100644
--- a/mysys/my_messnc.c
+++ b/mysys/my_messnc.c
@@ -23,7 +23,11 @@ int my_message_no_curses(uint error __attribute__((unused)),
DBUG_PRINT("enter",("message: %s",str));
(void) fflush(stdout);
if (MyFlags & ME_BELL)
+#ifdef __NETWARE__
+ ringbell(); /* Bell */
+#else
(void) fputc('\007',stderr); /* Bell */
+#endif /* __NETWARE__ */
if (my_progname)
{
(void)fputs(my_progname,stderr); (void)fputs(": ",stderr);
diff --git a/mysys/my_netware.c b/mysys/my_netware.c
new file mode 100644
index 00000000000..6c3242594df
--- /dev/null
+++ b/mysys/my_netware.c
@@ -0,0 +1,150 @@
+/* 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; 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 */
+
+/*
+ Function specific to netware
+*/
+
+#include <mysys_priv.h>
+#ifdef __NETWARE__
+ #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
+);
+
+ypedef long(*PMUR)(char*, long, char*, char, 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__ */
diff --git a/mysys/my_os2cond.c b/mysys/my_os2cond.c
index d930aadb2d1..e23afb89e66 100644
--- a/mysys/my_os2cond.c
+++ b/mysys/my_os2cond.c
@@ -26,7 +26,6 @@
#include "mysys_priv.h"
#if defined(THREAD) && defined(OS2)
#include <m_string.h>
-//#undef getpid
#include <process.h>
#include <sys/timeb.h>
diff --git a/mysys/my_os2dirsrch.c b/mysys/my_os2dirsrch.c
index 773d6800d1e..8d1f6ddd947 100644
--- a/mysys/my_os2dirsrch.c
+++ b/mysys/my_os2dirsrch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) Yuri Dario & 2000 MySQL AB
+/* Copyright (C) Yuri Dario & 2000-2003 MySQL AB
All the above parties has a full, independent copyright to
the following code, including the right to use the code in
any manner without any demands from the other parties.
@@ -18,77 +18,79 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
+
/* Win32 directory search emulation */
#if defined(OS2)
-//#define _DEBUG
-
long _findfirst( char* path, struct _finddata_t* dos_file)
{
- HDIR hdir = HDIR_CREATE;
- APIRET rc;
- FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ HDIR hdir = HDIR_CREATE;
+ APIRET rc;
+ FILEFINDBUF3 buf3;
+ ULONG entries = 1;
#ifdef _DEBUG
- printf( "_findfirst path %s\n", path);
+ printf( "_findfirst path %s\n", path);
#endif
- memset( &buf3, 0, sizeof( buf3));
- rc = DosFindFirst(
- path, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
- &hdir, /* Address of the handle associated with this DosFindFirst request. */
- FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
- &buf3, /* Result buffer. */
- sizeof( buf3), /* The length, in bytes, of pfindbuf. */
- &entries, /* Pointer to the number of entries: */
- FIL_STANDARD); /* The level of file information required. */
+ memset( &buf3, 0, sizeof( buf3));
+ rc = DosFindFirst(
+ path, /* The ASCIIZ path name of the file or subdirectory to be found. */
+ &hdir, /* The handle associated with this DosFindFirst request. */
+ FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
+ &buf3, /* Result buffer. */
+ sizeof( buf3), /* The length, in bytes, of pfindbuf. */
+ &entries, /* Pointer to the number of entries: */
+ FIL_STANDARD); /* The level of file information required. */
#ifdef _DEBUG
- printf( "_findfirst rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries, buf3.achName);
+ printf( "_findfirst rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries,
+ buf3.achName);
#endif
- if (rc /* && entries == 0 */)
- return -1;
-
- if (dos_file) {
- memset( dos_file, 0, sizeof( struct _finddata_t));
- strcpy( dos_file->name, buf3.achName);
- dos_file->size = buf3.cbFile;
- dos_file->attrib = buf3.attrFile;
- }
- return (ULONG) hdir;
+ if (rc /* && entries == 0 */)
+ return -1;
+
+ if (dos_file)
+ {
+ memset( dos_file, 0, sizeof( struct _finddata_t));
+ strcpy( dos_file->name, buf3.achName);
+ dos_file->size = buf3.cbFile;
+ dos_file->attrib = buf3.attrFile;
+ }
+ return (ULONG) hdir;
}
long _findnext( long hdir, struct _finddata_t* dos_file)
{
- APIRET rc;
- FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ APIRET rc;
+ FILEFINDBUF3 buf3;
+ ULONG entries = 1;
- memset( &buf3, 0, sizeof( buf3));
- rc = DosFindNext(
- hdir,
- &buf3, /* Result buffer. */
- sizeof( buf3), /* The length, in bytes, of pfindbuf. */
- &entries); /* Pointer to the number of entries: */
+ memset( &buf3, 0, sizeof( buf3));
+ rc = DosFindNext(hdir,
+ &buf3, /* Result buffer. */
+ sizeof( buf3), /* Length, in bytes, of pfindbuf. */
+ &entries); /* Pointer to the number of entries */
#ifdef _DEBUG
- printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries, buf3.achName);
+ printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, hdir, entries,
+ buf3.achName);
#endif
- if (rc /* && entries == 0 */)
- return -1;
-
- if (dos_file) {
- memset( dos_file, 0, sizeof( struct _finddata_t));
- strcpy( dos_file->name, buf3.achName);
- dos_file->size = buf3.cbFile;
- dos_file->attrib = buf3.attrFile;
- }
- return 0;
+ if (rc /* && entries == 0 */)
+ return -1;
+
+ if (dos_file)
+ {
+ memset( dos_file, 0, sizeof( struct _finddata_t));
+ strcpy( dos_file->name, buf3.achName);
+ dos_file->size = buf3.cbFile;
+ dos_file->attrib = buf3.attrFile;
+ }
+ return 0;
}
void _findclose( long hdir)
@@ -101,82 +103,82 @@ void _findclose( long hdir)
#endif
}
-DIR* opendir( char* path)
+DIR* opendir(char* path)
{
- DIR* dir = (DIR*) calloc( 1, sizeof( DIR));
- char buffer[260];
- APIRET rc;
- ULONG entries = 1;
+ DIR* dir = (DIR*) calloc(1, sizeof( DIR));
+ char buffer[260];
+ APIRET rc;
+ ULONG entries = 1;
- strcpy( buffer, path);
- strcat( buffer, "*.*");
+ strmov(strmov(buffer, path), "*.*");
#ifdef _DEBUG
- printf( "_findfirst path %s\n", buffer);
+ printf( "_findfirst path %s\n", buffer);
#endif
- dir->hdir = HDIR_CREATE;
- memset( &dir->buf3, 0, sizeof( dir->buf3));
- rc = DosFindFirst(
- buffer, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
- &dir->hdir, /* Address of the handle associated with this DosFindFirst request. */
- FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
- &dir->buf3, /* Result buffer. */
- sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
- &entries, /* Pointer to the number of entries: */
- FIL_STANDARD); /* The level of file information required. */
+ dir->hdir = HDIR_CREATE;
+ memset( &dir->buf3, 0, sizeof( dir->buf3));
+ rc = DosFindFirst(
+ buffer, /* Address of the ASCIIZ path name of the file or subdirectory to be found. */
+ &dir->hdir, /* Address of the handle associated with this DosFindFirst request. */
+ FILE_NORMAL | FILE_DIRECTORY, /* Attribute value that determines the file objects to be searched for. */
+ &dir->buf3, /* Result buffer. */
+ sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
+ &entries, /* Pointer to the number of entries: */
+ FIL_STANDARD); /* The level of file information required. */
#ifdef _DEBUG
- printf( "opendir rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries, dir->buf3.achName);
+ printf( "opendir rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries, dir->buf3.achName);
#endif
- if (rc /* && entries == 0 */)
- return NULL;
+ if (rc /* && entries == 0 */)
+ return NULL;
- return dir;
+ return dir;
}
+
struct dirent* readdir( DIR* dir)
{
- APIRET rc;
- //FILEFINDBUF3 buf3;
- ULONG entries = 1;
+ APIRET rc;
+ ULONG entries = 1;
- if (!dir->buf3.achName[0]) // file not found on previous query
- return NULL;
+ if (!dir->buf3.achName[0]) /* file not found on previous query */
+ return NULL;
- // copy last file name
- strcpy( dir->ent.d_name, dir->buf3.achName);
+ /* copy last file name */
+ strcpy( dir->ent.d_name, dir->buf3.achName);
- // query next file
- memset( &dir->buf3, 0, sizeof( dir->buf3));
- rc = DosFindNext(
- dir->hdir,
- &dir->buf3, /* Result buffer. */
- sizeof( dir->buf3), /* The length, in bytes, of pfindbuf. */
- &entries); /* Pointer to the number of entries: */
+ /* query next file */
+ memset( &dir->buf3, 0, sizeof( dir->buf3));
+ rc= DosFindNext(
+ dir->hdir,
+ &dir->buf3, /* Result buffer. */
+ sizeof(dir->buf3), /* Length, in bytes, of pfindbuf. */
+ &entries); /* Pointer to the number of entries */
#ifdef _DEBUG
- printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries, dir->buf3.achName);
+ printf( "_findnext rc=%d hdir=%d entries=%d->%s\n", rc, dir->hdir, entries,
+ dir->buf3.achName);
#endif
- if (rc /* && entries == 0 */)
- strcpy( dir->buf3.achName, ""); // reset name for next query
+ if (rc /* && entries == 0 */)
+ *dir->buf3.achName= 0; /* reset name for next query */
- return &dir->ent;
+ return &dir->ent;
}
+
int closedir (DIR *dir)
{
- APIRET rc;
+ APIRET rc;
- rc = DosFindClose( dir->hdir);
+ rc = DosFindClose( dir->hdir);
#ifdef _DEBUG
- printf( "_findclose rc=%d hdir=%d\n", rc, dir->hdir);
+ printf( "_findclose rc=%d hdir=%d\n", rc, dir->hdir);
#endif
- free(dir);
- return 0;
+ free(dir);
+ return 0;
}
-
-#endif // OS2
+#endif /* OS2 */
diff --git a/mysys/my_os2dirsrch.h b/mysys/my_os2dirsrch.h
index e894d27b576..3889f628bad 100644
--- a/mysys/my_os2dirsrch.h
+++ b/mysys/my_os2dirsrch.h
@@ -29,26 +29,35 @@ extern "C" {
struct _finddata_t
{
- unsigned attrib;
- //unsigned long time_create; /* -1 for FAT file systems */
- //unsigned long time_access; /* -1 for FAT file systems */
- //unsigned long time_write;
- unsigned long size;
- char name[260];
- //uint16 wr_date;
- //uint16 wr_time;
+ unsigned attrib;
+#ifdef NOT_USED
+ unsigned long time_create; /* -1 for FAT file systems */
+ unsigned long time_access; /* -1 for FAT file systems */
+ unsigned long time_write;
+#endif
+ unsigned long size;
+ char name[260];
+#ifdef NOT_USED
+ uint16 wr_date;
+ uint16 wr_time;
+#endif
};
+
struct dirent
{
- //unsigned attrib;
- //unsigned long time_create; /* -1 for FAT file systems */
- //unsigned long time_access; /* -1 for FAT file systems */
- //unsigned long time_write;
- //unsigned long size;
- char d_name[260];
- //uint16 wr_date;
- //uint16 wr_time;
+#ifdef NOT_USED
+ unsigned attrib;
+ unsigned long time_create; /* -1 for FAT file systems */
+ unsigned long time_access; /* -1 for FAT file systems */
+ unsigned long time_write;
+ unsigned long size;
+#endif
+ char d_name[260];
+#ifdef NOT_USED
+ uint16 wr_date;
+ uint16 wr_time;
+#endif
};
struct DIR
@@ -62,16 +71,18 @@ DIR *opendir ( char *);
struct dirent *readdir (DIR *);
int closedir (DIR *);
-//#define _A_NORMAL FILE_NORMAL
-//#define _A_SUBDIR FILE_DIRECTORY
-//#define _A_RDONLY FILE_READONLY
+#ifdef NOT_USED
+#define _A_NORMAL FILE_NORMAL
+#define _A_SUBDIR FILE_DIRECTORY
+#define _A_RDONLY FILE_READONLY
-//long _findfirst( char*, struct _finddata_t*);
-//long _findnext( long, struct _finddata_t*);
-//void _findclose( long);
+long _findfirst( char*, struct _finddata_t*);
+long _findnext( long, struct _finddata_t*);
+void _findclose( long);
+#endif
#ifdef __cplusplus_00
}
#endif
-#endif // __MY_OS2DIRSRCH2_H__
+#endif /* __MY_OS2DIRSRCH2_H__ */
diff --git a/mysys/my_os2file64.c b/mysys/my_os2file64.c
index bc24c92b87f..786e083adc4 100644
--- a/mysys/my_os2file64.c
+++ b/mysys/my_os2file64.c
@@ -24,10 +24,11 @@ int _lock64( int fd, int locktype, my_off_t start,
my_off_t length, myf MyFlags);
int _sopen64( const char *name, int oflag, int shflag, int mask);
-//
-// this class is used to define a global c++ variable, that
-// is initialized before main() gets called.
-//
+/*
+ This class is used to define a global c++ variable, that
+ is initialized before main() gets called.
+*/
+
class File64bit
{
public:
@@ -150,7 +151,7 @@ static unsigned char const errno_tab[] =
_DosSetFilePtrL = NULL;
return;
}
- // notify success
+ /* notify success */
#ifdef MYSQL_SERVER
printf( "WSeB 64bit file API loaded.\n");
#endif
@@ -164,230 +165,230 @@ void _OS2errno( APIRET rc)
errno = errno_tab[rc];
}
-longlong _lseek64( int fd, longlong offset, int seektype)
-{
- APIRET rc;
- longlong actual;
-
- if (_DosSetFilePtrL)
- rc = _DosSetFilePtrL( fd, offset, seektype, &actual);
- else {
- ULONG ulActual;
- rc = DosSetFilePtr( fd, (long) offset, seektype, &ulActual);
- actual = ulActual;
- }
-
- if (!rc)
- return( actual);/* NO_ERROR */
-
- // set errno
- _OS2errno( rc);
- // seek failed
- return(-1);
-}
-inline _SetFileLocksL(HFILE hFile,
- PFILELOCKL pflUnlock,
- PFILELOCKL pflLock,
- ULONG timeout,
- ULONG flags)
+longlong _lseek64( int fd, longlong offset, int seektype)
{
- if (_DosSetFileLocksL) {
- APIRET rc;
- rc = _DosSetFileLocksL( hFile, pflUnlock, pflLock, timeout, flags);
+ APIRET rc;
+ longlong actual;
- // on FAT/HPFS/LAN a INVALID_PARAMETER is returned, seems that
- // only JFS can handle >2GB ranges.
- if (rc != 87)
- return rc;
+ if (_DosSetFilePtrL)
+ rc = _DosSetFilePtrL( fd, offset, seektype, &actual);
+ else
+ {
+ ULONG ulActual;
+ rc = DosSetFilePtr( fd, (long) offset, seektype, &ulActual);
+ actual = ulActual;
+ }
- // got INVALID_PARAMETER, fallback to standard call
- }
+ if (!rc)
+ return( actual); /* NO_ERROR */
- FILELOCK flUnlock = { pflUnlock->lOffset, pflUnlock->lRange };
- FILELOCK flLock = { pflLock->lOffset, pflLock->lRange };
- return DosSetFileLocks( hFile, &flUnlock, &flLock, timeout, flags);
+ _OS2errno( rc); /* set errno */
+ return(-1); /* seek failed */
}
-int _lock64( int fd, int locktype, my_off_t start,
- my_off_t length, myf MyFlags)
-{
- FILELOCKL LockArea = {0,0}, UnlockArea = {0,0};
- ULONG readonly = 0;
- APIRET rc = -1;
-
- switch( locktype) {
- case F_UNLCK:
- UnlockArea.lOffset = start;
- UnlockArea.lRange = length ? length : LONGLONG_MAX;
- break;
-
- case F_RDLCK:
- case F_WRLCK:
- LockArea.lOffset = start;
- LockArea.lRange = length ? length : LONGLONG_MAX;
- readonly = (locktype == F_RDLCK ? 1 : 0);
- break;
-
- default:
- errno = EINVAL;
- rc = -1;
- break;
- }
-
- if (MyFlags & MY_DONT_WAIT) {
-
- rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 0, readonly);
- //printf( "fd %d, locktype %d, rc %d (dont_wait)\n", fd, locktype, rc);
- if (rc == 33) { /* Lock Violation */
-
- DBUG_PRINT("info",("Was locked, trying with timeout"));
- rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 1 * 1000, readonly);
- //printf( "fd %d, locktype %d, rc %d (dont_wait with timeout)\n", fd, locktype, rc);
- }
-
- } else {
-
- while( rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 0, readonly) && (rc == 33)) {
- printf(".");
- DosSleep(1 * 1000);
- }
- //printf( "fd %d, locktype %d, rc %d (wait2)\n", fd, locktype, rc);
- }
-
- if (!rc)
- return( 0);/* NO_ERROR */
- // set errno
- _OS2errno( rc);
- // lock failed
- return(-1);
+inline APIRET _SetFileLocksL(HFILE hFile,
+ PFILELOCKL pflUnlock,
+ PFILELOCKL pflLock,
+ ULONG timeout,
+ ULONG flags)
+{
+ if (_DosSetFileLocksL)
+ {
+ APIRET rc;
+ rc = _DosSetFileLocksL( hFile, pflUnlock, pflLock, timeout, flags);
+
+ /*
+ on FAT/HPFS/LAN a INVALID_PARAMETER is returned, seems that
+ only JFS can handle >2GB ranges.
+ */
+ if (rc != 87)
+ return rc;
+ /* got INVALID_PARAMETER, fallback to standard call */
+ }
+
+ FILELOCK flUnlock = { pflUnlock->lOffset, pflUnlock->lRange };
+ FILELOCK flLock = { pflLock->lOffset, pflLock->lRange };
+ return DosSetFileLocks( hFile, &flUnlock, &flLock, timeout, flags);
}
-int sopen( const char *name, int oflag, int shflag, int mask)
+
+int _lock64( int fd, int locktype, my_off_t start,
+ my_off_t length, myf MyFlags)
{
- int fail_errno;
- APIRET rc = 0;
- HFILE hf = 0;
- ULONG ulAction = 0;
- LONGLONG cbFile = 0;
- ULONG ulAttribute = FILE_NORMAL;
- ULONG fsOpenFlags = 0;
- ULONG fsOpenMode = 0;
-
- /* Extract the access mode and sharing mode bits. */
- fsOpenMode = (shflag & 0xFF) | (oflag & 0x03);
-
- /* Translate ERROR_OPEN_FAILED to ENOENT unless O_EXCL is set (see
- below). */
- fail_errno = ENOENT;
-
- /* Compute `open_flag' depending on `flags'. Note that _SO_CREAT is
- set for O_CREAT. */
-
- if (oflag & O_CREAT)
- {
- if (oflag & O_EXCL)
- {
- fsOpenFlags = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
- fail_errno = EEXIST;
- }
- else if (oflag & O_TRUNC)
- fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
- else
- fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
-
- if (mask & S_IWRITE)
- ulAttribute = FILE_NORMAL;
- else
- ulAttribute = FILE_READONLY;
+ FILELOCKL LockArea = {0,0}, UnlockArea = {0,0};
+ ULONG readonly = 0;
+ APIRET rc = -1;
+
+ switch (locktype) {
+ case F_UNLCK:
+ UnlockArea.lOffset = start;
+ UnlockArea.lRange = length ? length : LONGLONG_MAX;
+ break;
+
+ case F_RDLCK:
+ case F_WRLCK:
+ LockArea.lOffset = start;
+ LockArea.lRange = length ? length : LONGLONG_MAX;
+ readonly = (locktype == F_RDLCK ? 1 : 0);
+ break;
+
+ default:
+ errno = EINVAL;
+ rc = -1;
+ break;
+ }
+
+ if (MyFlags & MY_DONT_WAIT)
+ {
+ rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 0, readonly);
+ /* printf("fd %d, locktype %d, rc %d (dont_wait)\n", fd, locktype, rc); */
+ if (rc == 33) { /* Lock Violation */
+
+ DBUG_PRINT("info",("Was locked, trying with timeout"));
+ rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 1 * 1000, readonly);
+ /* printf( "fd %d, locktype %d, rc %d (dont_wait with timeout)\n", fd, locktype, rc); */
+ }
+ }
+ else
+ {
+ while (rc = _SetFileLocksL( fd, &UnlockArea, &LockArea, 0, readonly) &&
+ (rc == 33))
+ {
+ printf(".");
+ DosSleep(1 * 1000);
+ }
+ /* printf( "fd %d, locktype %d, rc %d (wait2)\n", fd, locktype, rc); */
+ }
+ if (!rc)
+ return(0); /* NO_ERROR */
+ _OS2errno( rc); /* set errno */
+ return(-1); /* lock failed */
+}
- }
- else if (oflag & O_TRUNC)
- fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
- else
- fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
-
- /* Try to open the file and handle errors. */
- if (_DosOpenL)
- rc = _DosOpenL( name, &hf, &ulAction, cbFile,
- ulAttribute, fsOpenFlags, fsOpenMode, NULL);
- else
- rc = DosOpen( name, &hf, &ulAction, (LONG) cbFile,
- ulAttribute, fsOpenFlags, fsOpenMode, NULL);
-
- if (rc == ERROR_OPEN_FAILED)
- {
- errno = fail_errno;
- return -1;
- }
- if (rc != 0)
- {
- // set errno
- _OS2errno( rc);
- return -1;
- }
- if (oflag & O_APPEND)
- _lseek64( hf, 0L, SEEK_END);
+int sopen(const char *name, int oflag, int shflag, int mask)
+{
+ int fail_errno;
+ APIRET rc = 0;
+ HFILE hf = 0;
+ ULONG ulAction = 0;
+ LONGLONG cbFile = 0;
+ ULONG ulAttribute = FILE_NORMAL;
+ ULONG fsOpenFlags = 0;
+ ULONG fsOpenMode = 0;
+
+ /* Extract the access mode and sharing mode bits. */
+ fsOpenMode = (shflag & 0xFF) | (oflag & 0x03);
+
+ /*
+ Translate ERROR_OPEN_FAILED to ENOENT unless O_EXCL is set (see
+ below).
+ */
+ fail_errno = ENOENT;
+
+ /*
+ Compute `open_flag' depending on `flags'. Note that _SO_CREAT is
+ set for O_CREAT.
+ */
+
+ if (oflag & O_CREAT)
+ {
+ if (oflag & O_EXCL)
+ {
+ fsOpenFlags = OPEN_ACTION_FAIL_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+ fail_errno = EEXIST;
+ }
+ else if (oflag & O_TRUNC)
+ fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+ else
+ fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW;
+
+ if (mask & S_IWRITE)
+ ulAttribute = FILE_NORMAL;
+ else
+ ulAttribute = FILE_READONLY;
+
+ }
+ else if (oflag & O_TRUNC)
+ fsOpenFlags = OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
+ else
+ fsOpenFlags = OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW;
- return hf;
+ /* Try to open the file and handle errors. */
+ if (_DosOpenL)
+ rc = _DosOpenL( name, &hf, &ulAction, cbFile,
+ ulAttribute, fsOpenFlags, fsOpenMode, NULL);
+ else
+ rc = DosOpen( name, &hf, &ulAction, (LONG) cbFile,
+ ulAttribute, fsOpenFlags, fsOpenMode, NULL);
+
+ if (rc == ERROR_OPEN_FAILED)
+ {
+ errno = fail_errno;
+ return -1;
+ }
+ if (rc != 0)
+ {
+ _OS2errno( rc); /* set errno */
+ return -1;
+ }
+ if (oflag & O_APPEND)
+ _lseek64( hf, 0L, SEEK_END);
+ return hf;
}
-int read( int fd, void *buffer, unsigned int count)
-{
- APIRET rc;
- ULONG actual;
- rc = DosRead( fd, (PVOID) buffer, count, &actual);
+int read(int fd, void *buffer, unsigned int count)
+{
+ APIRET rc;
+ ULONG actual;
- if (!rc)
- return( actual);/* NO_ERROR */
+ rc= DosRead( fd, (PVOID) buffer, count, &actual);
- // set errno
- _OS2errno( rc);
- // write failed
- return(-1);
+ if (!rc)
+ return( actual); /* NO_ERROR */
+ _OS2errno( rc); /* set errno */
+ return(-1); /* read failed */
}
-int write( int fd, const void *buffer, unsigned int count)
-{
- APIRET rc;
- ULONG actual;
- rc = DosWrite( fd, (PVOID) buffer, count, &actual);
+int write(int fd, const void *buffer, unsigned int count)
+{
+ APIRET rc;
+ ULONG actual;
- if (!rc)
- return( actual);/* NO_ERROR */
+ rc = DosWrite( fd, (PVOID) buffer, count, &actual);
- // set errno
- _OS2errno( rc);
- // write failed
- return(-1);
+ if (!rc)
+ return( actual); /* NO_ERROR */
+ _OS2errno( rc); /* set errno */
+ return(-1); /* write failed */
}
-int close( int fd)
-{
- APIRET rc;
- ULONG actual;
- rc = DosClose( fd);
+int close( int fd)
+{
+ APIRET rc;
+ ULONG actual;
- if (!rc)
- return( 0);/* NO_ERROR */
+ rc = DosClose( fd);
- // set errno
- _OS2errno( rc);
- // write failed
- return(-1);
+ if (!rc)
+ return( 0); /* NO_ERROR */
+ _OS2errno( rc); /* set errno */
+ return(-1); /* close failed */
}
-inline int open( const char *name, int oflag)
+
+int open( const char *name, int oflag)
{
return sopen( name, oflag, OPEN_SHARE_DENYNONE, S_IREAD | S_IWRITE);
}
-inline int open( const char *name, int oflag, int mask)
+
+int open( const char *name, int oflag, int mask)
{
return sopen( name, oflag, OPEN_SHARE_DENYNONE, mask);
}
diff --git a/mysys/my_os2mutex.c b/mysys/my_os2mutex.c
index 718aa9f2932..5010d6e8dd5 100644
--- a/mysys/my_os2mutex.c
+++ b/mysys/my_os2mutex.c
@@ -36,63 +36,48 @@
#include <stdlib.h>
#include <errno.h>
#ifdef _THREAD_SAFE
-//#include <pthread.h>
-//#include "pthread_private.h"
int
pthread_mutex_init(pthread_mutex_t * mutex,
const pthread_mutexattr_t * mutex_attr)
{
- APIRET rc = 0;
-
- rc = DosCreateMutexSem(NULL,mutex,0,0);
-
- /* Return the completion status: */
- return (0);
+ (void) DosCreateMutexSem(NULL,mutex,0,0);
+ return (0); /* Return the completion status: */
}
+
int
pthread_mutex_destroy(pthread_mutex_t * mutex)
{
- APIRET rc = 0;
-
+ APIRET rc;
- do {
- rc = DosCloseMutexSem(*mutex);
- if (rc == 301) DosReleaseMutexSem(*mutex);
- } while (rc == 301);
+ do
+ {
+ rc = DosCloseMutexSem(*mutex);
+ if (rc == 301) DosReleaseMutexSem(*mutex);
+ } while (rc == 301);
- *mutex = 0;
-
- /* Return the completion status: */
- return (0);
+ *mutex = 0;
+ return (0); /* Return the completion status: */
}
int
pthread_mutex_lock(pthread_mutex_t * mutex)
{
- int ret = 0;
- int status = 0;
- APIRET rc = 0;
+ APIRET rc;
- rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
- if (rc)
- return(EINVAL);
- /* Return the completion status: */
- return (0);
+ rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
+ if (rc)
+ return(EINVAL);
+ return (0); /* Return the completion status: */
}
+
int
pthread_mutex_unlock(pthread_mutex_t * mutex)
{
- int ret = 0;
- APIRET rc = 0;
- int status;
-
- rc = DosReleaseMutexSem(*mutex);
-
- /* Return the completion status: */
- return (0);
+ (void) DosReleaseMutexSem(*mutex);
+ return (0); /* Return the completion status: */
}
#endif
diff --git a/mysys/my_os2thread.c b/mysys/my_os2thread.c
index 6f196f43d75..0696f480a91 100644
--- a/mysys/my_os2thread.c
+++ b/mysys/my_os2thread.c
@@ -61,10 +61,9 @@ static pthread_handler_decl(pthread_start,param)
win_pthread_self=((struct pthread_map *) param)->pthreadself;
pthread_mutex_unlock(&THR_LOCK_thread);
free((char*) param); /* Free param from create */
- //pthread_exit((void*) (*func)(func_param));
+ /* pthread_exit((void*) (*func)(func_param)); */
(*func)(func_param);
DBUG_RETURN(0);
- //return 0; /* Safety */
}
diff --git a/mysys/my_os2tls.c b/mysys/my_os2tls.c
index 1598fa34e2b..f7cf3b09283 100644
--- a/mysys/my_os2tls.c
+++ b/mysys/my_os2tls.c
@@ -30,115 +30,122 @@ PULONG tls_storage; /* TLS local storage */
DWORD tls_bits[2]; /* TLS in-use bits */
pthread_mutex_t tls_mutex; /* TLS mutex for in-use bits */
+
DWORD TlsAlloc( void)
{
- DWORD index = -1;
- DWORD mask, tibidx;
- int i;
-
- if (tls_storage == NULL) {
-
- APIRET rc;
-
- // allocate memory for TLS storage
- rc = DosAllocThreadLocalMemory( 1, &tls_storage);
- if (rc) {
- fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n", rc);
- }
-
- // create a mutex
- if (pthread_mutex_init( &tls_mutex, NULL))
- fprintf( stderr, "Failed to init TLS mutex\n");
- }
-
- pthread_mutex_lock( &tls_mutex);
-
- tibidx = 0;
- if (tls_bits[0] == 0xFFFFFFFF) {
- if (tls_bits[1] == 0xFFFFFFFF) {
- fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
- pthread_mutex_unlock( &tls_mutex);
- return -1;
- }
- tibidx = 1;
- }
- for( i=0; i<32; i++) {
- mask = (1 << i);
- if ((tls_bits[ tibidx] & mask) == 0) {
- tls_bits[ tibidx] |= mask;
- index = (tibidx*32) + i;
- break;
- }
- }
- tls_storage[index] = 0;
-
- pthread_mutex_unlock( &tls_mutex);
-
- //fprintf( stderr, "tid#%d, TlsAlloc index %d\n", _threadid, index);
-
- return index;
+ DWORD index = -1;
+ DWORD mask, tibidx;
+ int i;
+
+ if (tls_storage == NULL)
+ {
+
+ APIRET rc;
+
+ /* allocate memory for TLS storage */
+ rc = DosAllocThreadLocalMemory( 1, &tls_storage);
+ if (rc)
+ fprintf( stderr, "DosAllocThreadLocalMemory error: return code = %u\n",
+ rc);
+ /* create a mutex */
+ if (pthread_mutex_init( &tls_mutex, NULL))
+ fprintf( stderr, "Failed to init TLS mutex\n");
+ }
+
+ pthread_mutex_lock( &tls_mutex);
+
+ tibidx = 0;
+ if (tls_bits[0] == 0xFFFFFFFF)
+ {
+ if (tls_bits[1] == 0xFFFFFFFF)
+ {
+ fprintf( stderr, "tid#%d, no more TLS bits available\n", _threadid);
+ pthread_mutex_unlock( &tls_mutex);
+ return -1;
+ }
+ tibidx = 1;
+ }
+
+ for (i=0; i<32; i++)
+ {
+ mask = (1 << i);
+ if ((tls_bits[ tibidx] & mask) == 0)
+ {
+ tls_bits[ tibidx] |= mask;
+ index = (tibidx*32) + i;
+ break;
+ }
+ }
+ tls_storage[index] = 0;
+
+ pthread_mutex_unlock( &tls_mutex);
+ /* fprintf( stderr, "tid#%d, TlsAlloc index %d\n", _threadid, index); */
+ return index;
}
-BOOL TlsFree( DWORD index)
+BOOL TlsFree( DWORD index)
{
- int tlsidx;
- DWORD mask;
-
- if (index >= TLS_MINIMUM_AVAILABLE)
- return NULL;
-
- pthread_mutex_lock( &tls_mutex);
-
- tlsidx = 0;
- if (index > 32) {
- tlsidx++;
- }
- mask = (1 << index);
- if (tls_bits[ tlsidx] & mask) {
- tls_bits[tlsidx] &= ~mask;
- tls_storage[index] = 0;
- pthread_mutex_unlock( &tls_mutex);
- return TRUE;
- }
+ int tlsidx;
+ DWORD mask;
- pthread_mutex_unlock( &tls_mutex);
- return FALSE;
-}
+ if (index >= TLS_MINIMUM_AVAILABLE)
+ return NULL;
+ pthread_mutex_lock( &tls_mutex);
-PVOID TlsGetValue( DWORD index)
-{
- if (index >= TLS_MINIMUM_AVAILABLE)
- return NULL;
-
- // verify if memory has been allocated for this thread
- if (*tls_storage == NULL) {
- // allocate memory for indexes
- *tls_storage = (ULONG)calloc( TLS_MINIMUM_AVAILABLE, sizeof(int));
- //fprintf( stderr, "tid#%d, tls_storage %x\n", _threadid, *tls_storage);
- }
-
- ULONG* tls_array = (ULONG*) *tls_storage;
- return (PVOID) tls_array[ index];
+ tlsidx = 0;
+ if (index > 32)
+ tlsidx++;
+
+ mask = (1 << index);
+ if (tls_bits[ tlsidx] & mask)
+ {
+ tls_bits[tlsidx] &= ~mask;
+ tls_storage[index] = 0;
+ pthread_mutex_unlock( &tls_mutex);
+ return TRUE;
+ }
+
+ pthread_mutex_unlock( &tls_mutex);
+ return FALSE;
}
-BOOL TlsSetValue( DWORD index, PVOID val)
-{
- // verify if memory has been allocated for this thread
- if (*tls_storage == NULL) {
- // allocate memory for indexes
- *tls_storage = (ULONG)calloc( TLS_MINIMUM_AVAILABLE, sizeof(int));
- //fprintf( stderr, "tid#%d, tls_storage %x\n", _threadid, *tls_storage);
- }
+PVOID TlsGetValue( DWORD index)
+{
+ if (index >= TLS_MINIMUM_AVAILABLE)
+ return NULL;
+
+ /* verify if memory has been allocated for this thread */
+ if (*tls_storage == NULL)
+ {
+ /* allocate memory for indexes */
+ *tls_storage = (ULONG)calloc( TLS_MINIMUM_AVAILABLE, sizeof(int));
+ /* fprintf(stderr, "tid#%d, tls_storage %x\n", _threadid, *tls_storage); */
+ }
+
+ ULONG* tls_array = (ULONG*) *tls_storage;
+ return (PVOID) tls_array[index];
+}
- if (index >= TLS_MINIMUM_AVAILABLE)
- return FALSE;
- ULONG* tls_array = (ULONG*) *tls_storage;
- //fprintf( stderr, "tid#%d, TlsSetValue array %08x index %d -> %08x (old)\n", _threadid, tls_array, index, tls_array[ index]);
- tls_array[ index] = (ULONG) val;
- //fprintf( stderr, "tid#%d, TlsSetValue array %08x index %d -> %08x\n", _threadid, tls_array, index, val);
+BOOL TlsSetValue( DWORD index, PVOID val)
+{
- return TRUE;
+ /* verify if memory has been allocated for this thread */
+ if (*tls_storage == NULL)
+ {
+ /* allocate memory for indexes */
+ *tls_storage = (ULONG)calloc( TLS_MINIMUM_AVAILABLE, sizeof(int));
+ /* fprintf(stderr, "tid#%d, tls_storage %x\n", _threadid, *tls_storage); */
+ }
+
+ if (index >= TLS_MINIMUM_AVAILABLE)
+ return FALSE;
+
+ ULONG* tls_array = (ULONG*) *tls_storage;
+ /* fprintf( stderr, "tid#%d, TlsSetValue array %08x index %d -> %08x (old)\n", _threadid, tls_array, index, tls_array[ index]); */
+ tls_array[ index] = (ULONG) val;
+ /* fprintf( stderr, "tid#%d, TlsSetValue array %08x index %d -> %08x\n", _threadid, tls_array, index, val); */
+ return TRUE;
}
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index 07e8ecec6ac..0de7041fae7 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -425,6 +425,19 @@ int my_pthread_cond_init(pthread_cond_t *mp, const pthread_condattr_t *attr)
#endif
+#ifdef __NETWARE__
+/* NetWare does not re-acquire the lock if the condition fails */
+int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
+ struct timespec *abstime)
+{
+ int err= pthread_cond_timedwait(cond, mutex, abstime);
+ if (err)
+ pthread_mutex_lock(mutex);
+ return err;
+}
+#endif /* __NETWARE__ */
+
+
/*****************************************************************************
Patches for HPUX
We need these because the pthread_mutex.. code returns -1 on error,
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index b5a79d9454b..9ba03cd9526 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -90,7 +90,7 @@ int my_copystat(const char *from, const char *to, int MyFlags)
return 1;
VOID(chmod(to, statbuf.st_mode & 07777)); /* Copy modes */
-#if !defined(MSDOS) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
+#if !defined(MSDOS) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING)
{
if (MyFlags & MY_LINK_WARNING)
diff --git a/mysys/mf_sleep.c b/mysys/my_sleep.c
index 49db465e7c5..3de2d2abd13 100644
--- a/mysys/mf_sleep.c
+++ b/mysys/my_sleep.c
@@ -14,22 +14,25 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Wait a given time (On systems that dont have sleep !!; MSDOS) */
+/* Wait a given number of microseconds */
#include "mysys_priv.h"
#include <m_string.h>
-#ifdef _MSC_VER
-
-void sleep(sec)
-int sec;
+void my_sleep(ulong m_seconds)
{
- ulong start;
- DBUG_ENTER("sleep");
-
- start=(ulong) time((time_t*) 0);
+#ifdef __NETWARE__
+ delay(m_seconds/1000+1);
+#elif defined(OS2)
+ DosSleep(m_seconds/1000+1);
+#elif defined(HAVE_SELECT)
+ struct timeval t;
+ t.tv_sec= m_seconds / 1000000L;
+ t.tv_usec= m_seconds % 1000000L;
+ select(0,0,0,0,&t); /* sleep */
+#else
+ uint sec= (uint) (m_seconds / 1000000L);
+ ulong start= (ulong) time((time_t*) 0);
while ((ulong) time((time_t*) 0) < start+sec);
- DBUG_VOID_RETURN;
-} /* sleep */
-
-#endif /* MSDOS */
+#endif
+}
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index 4fa2dd2abc4..a652fae3574 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -38,7 +38,7 @@
#endif
#ifdef HAVE_TEMPNAM
-#if !defined( MSDOS) && !defined(OS2)
+#if !defined( MSDOS) && !defined(OS2) && !defined(__NETWARE__)
extern char **environ;
#endif
#endif
@@ -104,14 +104,14 @@ my_string my_tempnam(const char *dir, const char *pfx,
dir=temp;
}
#ifdef OS2
- // changing environ variable doesn't work with VACPP
+ /* changing environ variable doesn't work with VACPP */
char buffer[256];
sprintf( buffer, "TMP=%s", dir);
- // remove ending backslash
+ /* remove ending backslash */
if (buffer[strlen(buffer)-1] == '\\')
buffer[strlen(buffer)-1] = '\0';
putenv( buffer);
-#else
+#elif !defined(__NETWARE__)
old_env=(char**)environ;
if (dir)
{ /* Don't use TMPDIR if dir is given */
@@ -120,7 +120,7 @@ my_string my_tempnam(const char *dir, const char *pfx,
}
#endif
res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
-#ifndef OS2
+#if !defined(OS2) && !defined(__NETWARE__)
((char**) environ)=(char**) old_env;
#endif
if (!res)
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 45c10e5a7b6..59466083b28 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -94,6 +94,18 @@ void my_thread_global_end(void)
#ifdef PPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_errchk_mutexattr);
#endif
+ pthread_mutex_destroy(&THR_LOCK_malloc);
+ pthread_mutex_destroy(&THR_LOCK_open);
+ pthread_mutex_destroy(&THR_LOCK_keycache);
+ pthread_mutex_destroy(&THR_LOCK_lock);
+ pthread_mutex_destroy(&THR_LOCK_isam);
+ pthread_mutex_destroy(&THR_LOCK_myisam);
+ pthread_mutex_destroy(&THR_LOCK_heap);
+ pthread_mutex_destroy(&THR_LOCK_net);
+ pthread_mutex_destroy(&THR_LOCK_charset);
+#ifndef HAVE_LOCALTIME_R
+ pthread_mutex_destroy(&LOCK_localtime_r);
+#endif
#ifndef HAVE_GETHOSTBYNAME_R
pthread_mutex_destroy(&LOCK_gethostbyname_r);
#endif
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 75d77ed9987..f79431a0b0b 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -23,9 +23,9 @@
#ifdef THREAD
#include <my_pthread.h>
-extern pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open,THR_LOCK_keycache,
- THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_net,THR_LOCK_charset;
-extern pthread_mutex_t LOCK_bitmap;
+extern pthread_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
+extern pthread_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net;
+extern pthread_mutex_t THR_LOCK_charset;
#else
#include <my_no_pthread.h>
#endif
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index 89079fba31c..9cbb178edb4 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -239,8 +239,8 @@ gptr _myrealloc (register gptr pPtr, register uint uSize,
if (*((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc))
!= MAGICKEY)
{
- fprintf (stderr, "Reallocating unallocated data at line %d, '%s'\n",
- uLine, sFile);
+ fprintf(stderr, "Error: Reallocating unallocated data at line %d, '%s'\n",
+ uLine, sFile);
DBUG_PRINT("safe",("Reallocating unallocated data at line %d, '%s'",
uLine, sFile));
(void) fflush(stderr);
@@ -295,8 +295,8 @@ void _myfree (gptr pPtr, const char *sFile, uint uLine, myf myflags)
if (*((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc))
!= MAGICKEY)
{
- fprintf (stderr, "Freeing unallocated data at line %d, '%s'\n",
- uLine, sFile);
+ fprintf(stderr, "Error: Freeing unallocated data at line %d, '%s'\n",
+ uLine, sFile);
DBUG_PRINT("safe",("Unallocated data at line %d, '%s'",uLine,sFile));
(void) fflush(stderr);
DBUG_VOID_RETURN;
@@ -336,8 +336,8 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
{
if (!ptr)
{
- fprintf (stderr, "%s NULL pointer at line %d, '%s'\n",
- where,uLine, sFile);
+ fprintf(stderr, "Error: %s NULL pointer at line %d, '%s'\n",
+ where,uLine, sFile);
DBUG_PRINT("safe",("Null pointer at line %d '%s'", uLine, sFile));
(void) fflush(stderr);
return 1;
@@ -345,8 +345,8 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
#ifndef _MSC_VER
if ((long) ptr & (ALIGN_SIZE(1)-1))
{
- fprintf (stderr, "%s wrong aligned pointer at line %d, '%s'\n",
- where,uLine, sFile);
+ fprintf(stderr, "Error: %s wrong aligned pointer at line %d, '%s'\n",
+ where,uLine, sFile);
DBUG_PRINT("safe",("Wrong aligned pointer at line %d, '%s'",
uLine,sFile));
(void) fflush(stderr);
@@ -355,8 +355,8 @@ static int check_ptr(const char *where, byte *ptr, const char *sFile,
#endif
if (ptr < sf_min_adress || ptr > sf_max_adress)
{
- fprintf (stderr, "%s pointer out of range at line %d, '%s'\n",
- where,uLine, sFile);
+ fprintf(stderr, "Error: %s pointer out of range at line %d, '%s'\n",
+ where,uLine, sFile);
DBUG_PRINT("safe",("Pointer out of range at line %d '%s'",
uLine,sFile));
(void) fflush(stderr);
@@ -388,7 +388,7 @@ void TERMINATE (FILE *file)
{
if (file)
{
- fprintf (file, "cNewCount: %d\n", cNewCount);
+ fprintf(file, "Warning: Not freed memory segments: %d\n", cNewCount);
(void) fflush(file);
}
DBUG_PRINT("safe",("cNewCount: %d",cNewCount));
@@ -403,7 +403,7 @@ void TERMINATE (FILE *file)
{
if (file)
{
- fprintf(file, "Memory that was not free'ed (%ld bytes):\n",lCurMemory);
+ fprintf(file, "Warning: Memory that was not free'ed (%ld bytes):\n",lCurMemory);
(void) fflush(file);
}
DBUG_PRINT("safe",("Memory that was not free'ed (%ld bytes):",lCurMemory));
@@ -411,11 +411,11 @@ void TERMINATE (FILE *file)
{
if (file)
{
- fprintf (file,
- "\t%6u bytes at 0x%09lx, allocated at line %4u in '%s'",
- pPtr -> uDataSize,
- (ulong) &(pPtr -> aData[sf_malloc_prehunc]),
- pPtr -> uLineNum, pPtr -> sFileName);
+ fprintf(file,
+ "\t%6u bytes at 0x%09lx, allocated at line %4u in '%s'",
+ pPtr -> uDataSize,
+ (ulong) &(pPtr -> aData[sf_malloc_prehunc]),
+ pPtr -> uLineNum, pPtr -> sFileName);
fprintf(file, "\n");
(void) fflush(file);
}
@@ -429,8 +429,8 @@ void TERMINATE (FILE *file)
/* Report the memory usage statistics */
if (file)
{
- fprintf (file, "Maximum memory usage: %ld bytes (%ldk)\n",
- lMaxMemory, (lMaxMemory + 1023L) / 1024L);
+ fprintf(file, "Maximum memory usage: %ld bytes (%ldk)\n",
+ lMaxMemory, (lMaxMemory + 1023L) / 1024L);
(void) fflush(file);
}
DBUG_PRINT("safe",("Maximum memory usage: %ld bytes (%ldk)",
@@ -453,9 +453,9 @@ static int _checkchunk (register struct remember *pRec, const char *sFile,
if (*((long*) ((char*) &pRec -> lSpecialValue+sf_malloc_prehunc))
!= MAGICKEY)
{
- fprintf (stderr, "Memory allocated at %s:%d was underrun,",
- pRec -> sFileName, pRec -> uLineNum);
- fprintf (stderr, " discovered at %s:%d\n", sFile, uLine);
+ fprintf(stderr, "Error: Memory allocated at %s:%d was underrun,",
+ pRec -> sFileName, pRec -> uLineNum);
+ fprintf(stderr, " discovered at %s:%d\n", sFile, uLine);
(void) fflush(stderr);
DBUG_PRINT("safe",("Underrun at %lx, allocated at %s:%d",
&(pRec -> aData[sf_malloc_prehunc]),
@@ -472,9 +472,9 @@ static int _checkchunk (register struct remember *pRec, const char *sFile,
*magicp++ != MAGICEND2 ||
*magicp++ != MAGICEND3)
{
- fprintf (stderr, "Memory allocated at %s:%d was overrun,",
- pRec -> sFileName, pRec -> uLineNum);
- fprintf (stderr, " discovered at '%s:%d'\n", sFile, uLine);
+ fprintf(stderr, "Error: Memory allocated at %s:%d was overrun,",
+ pRec -> sFileName, pRec -> uLineNum);
+ fprintf(stderr, " discovered at '%s:%d'\n", sFile, uLine);
(void) fflush(stderr);
DBUG_PRINT("safe",("Overrun at %lx, allocated at %s:%d",
&(pRec -> aData[sf_malloc_prehunc]),
@@ -505,9 +505,9 @@ int _sanity (const char *sFile, uint uLine)
pthread_mutex_unlock(&THR_LOCK_malloc);
if (count || pTmp)
{
- const char *format="Safemalloc link list destroyed, discovered at '%s:%d'";
- fprintf (stderr, format, sFile, uLine); fputc('\n',stderr);
- fprintf (stderr, "root=%p,count=%d,pTmp=%p\n", pRememberRoot,count,pTmp);
+ const char *format="Error: Safemalloc link list destroyed, discovered at '%s:%d'";
+ fprintf(stderr, format, sFile, uLine); fputc('\n',stderr);
+ fprintf(stderr, "root=%p,count=%d,pTmp=%p\n", pRememberRoot,count,pTmp);
(void) fflush(stderr);
DBUG_PRINT("safe",(format, sFile, uLine));
flag=1;
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index ed468b5ef50..6697b9d3360 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -229,8 +229,13 @@ void thr_end_alarm(thr_alarm_t *alarmed)
(long) *alarmed));
}
if (alarm_aborted && !alarm_queue.elements)
+ {
delete_queue(&alarm_queue);
- pthread_mutex_unlock(&LOCK_alarm);
+ pthread_mutex_unlock(&LOCK_alarm);
+ pthread_mutex_destroy(&LOCK_alarm);
+ }
+ else
+ pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
DBUG_VOID_RETURN;
}
@@ -367,19 +372,25 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
void end_thr_alarm(void)
{
DBUG_ENTER("end_thr_alarm");
- pthread_mutex_lock(&LOCK_alarm);
if (!alarm_aborted)
- {
+ {
+ my_bool deleted=0;
+ pthread_mutex_lock(&LOCK_alarm);
DBUG_PRINT("info",("Resheduling %d waiting alarms",alarm_queue.elements));
alarm_aborted=1; /* mark aborted */
if (!alarm_queue.elements)
+ {
+ deleted= 1;
delete_queue(&alarm_queue);
+ }
if (pthread_equal(pthread_self(),alarm_thread))
alarm(1); /* Shut down everything soon */
else
reschedule_alarms();
+ pthread_mutex_unlock(&LOCK_alarm);
+ if (deleted)
+ pthread_mutex_destroy(&LOCK_alarm);
}
- pthread_mutex_unlock(&LOCK_alarm);
DBUG_VOID_RETURN;
}
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 6de96f0a24a..2aabe2f500a 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -20,13 +20,15 @@
#if defined(HAVE_LINUXTHREADS) && !defined (__USE_UNIX98)
#define __USE_UNIX98 /* To get rw locks under Linux */
#endif
-#include <m_string.h>
#if defined(THREAD) && defined(SAFE_MUTEX)
#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
-#include <my_pthread.h>
+#include "mysys_priv.h"
+#include "my_static.h"
+#include <m_string.h>
#ifndef DO_NOT_REMOVE_THREAD_WRAPPERS
/* Remove wrappers */
+#undef pthread_mutex_t
#undef pthread_mutex_init
#undef pthread_mutex_lock
#undef pthread_mutex_unlock
@@ -38,15 +40,55 @@
#endif
#endif /* DO_NOT_REMOVE_THREAD_WRAPPERS */
+static pthread_mutex_t THR_LOCK_mutex;
+static ulong safe_mutex_count= 0; /* Number of mutexes created */
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+static struct st_safe_mutex_info_t *safe_mutex_root= NULL;
+#endif
+
+void safe_mutex_global_init(void)
+{
+ pthread_mutex_init(&THR_LOCK_mutex,MY_MUTEX_INIT_FAST);
+}
+
+
int safe_mutex_init(safe_mutex_t *mp,
- const pthread_mutexattr_t *attr __attribute__((unused)))
+ const pthread_mutexattr_t *attr __attribute__((unused)),
+ const char *file __attribute__((unused)),
+ uint line __attribute__((unused)))
{
bzero((char*) mp,sizeof(*mp));
pthread_mutex_init(&mp->global,MY_MUTEX_INIT_ERRCHK);
pthread_mutex_init(&mp->mutex,attr);
+
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+ /*
+ Monitor the freeing of mutexes. This code depends on single thread init
+ and destroy
+ */
+ if ((mp->info= (safe_mutex_info_t *) malloc(sizeof(safe_mutex_info_t))))
+ {
+ struct st_safe_mutex_info_t *info =mp->info;
+
+ info->init_file= (char *) file;
+ info->init_line= line;
+ info->prev= NULL;
+ info->next= NULL;
+
+ pthread_mutex_lock(&THR_LOCK_mutex);
+ if ((info->next= safe_mutex_root))
+ safe_mutex_root->prev= info;
+ safe_mutex_root= info;
+ safe_mutex_count++;
+ pthread_mutex_unlock(&THR_LOCK_mutex);
+ }
+#else
+ thread_safe_increment(safe_mutex_count, &THR_LOCK_mutex);
+#endif /* SAFE_MUTEX_DETECT_DESTROY */
return 0;
}
+
int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
{
int error;
@@ -199,6 +241,11 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
fflush(stderr);
abort();
}
+#ifdef __NETWARE__
+ /* NetWare doesn't re-acquire the mutex on an error */
+ if (error && pthread_mutex_lock(&mp->mutex))
+ mp->count--;
+#endif /* __NETWARE__ */
mp->thread=pthread_self();
mp->file= (char*) file;
mp->line=line;
@@ -206,6 +253,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
return error;
}
+
int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
{
int error=0;
@@ -225,7 +273,70 @@ int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
if (pthread_mutex_destroy(&mp->mutex))
error=1;
#endif
+
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+ if (mp->info)
+ {
+ struct st_safe_mutex_info_t *info= mp->info;
+ pthread_mutex_lock(&THR_LOCK_mutex);
+
+ if (info->prev)
+ info->prev->next = info->next;
+ else
+ safe_mutex_root = info->next;
+ if (info->next)
+ info->next->prev = info->prev;
+ safe_mutex_count--;
+
+ pthread_mutex_unlock(&THR_LOCK_mutex);
+ free(info);
+ mp->info= NULL; /* Get crash if double free */
+ }
+#else
+ thread_safe_sub(safe_mutex_count, 1, &THR_LOCK_mutex);
+#endif /* SAFE_MUTEX_DETECT_DESTROY */
return error;
}
+
+/*
+ Free global resources and check that all mutex has been destroyed
+
+ SYNOPSIS
+ safe_mutex_end()
+ file Print errors on this file
+
+ NOTES
+ We can't use DBUG_PRINT() here as we have in my_end() disabled
+ DBUG handling before calling this function.
+
+ In MySQL one may get one warning for a mutex created in my_thr_init.c
+ This is ok, as this thread may not yet have been exited.
+*/
+
+void safe_mutex_end(FILE *file __attribute__((unused)))
+{
+ if (!safe_mutex_count) /* safetly */
+ pthread_mutex_destroy(&THR_LOCK_mutex);
+#ifdef SAFE_MUTEX_DETECT_DESTROY
+ if (!file)
+ return;
+
+ if (safe_mutex_count)
+ {
+ fprintf(file, "Warning: Not destroyed mutex: %lu\n", safe_mutex_count);
+ (void) fflush(file);
+ }
+ {
+ struct st_safe_mutex_info_t *ptr;
+ for (ptr= safe_mutex_root ; ptr ; ptr= ptr->next)
+ {
+ fprintf(file, "\tMutex initiated at line %4u in '%s'\n",
+ ptr->init_line, ptr->init_file);
+ (void) fflush(file);
+ }
+ }
+#endif /* SAFE_MUTEX_DETECT_DESTROY */
+}
+
#endif /* THREAD && SAFE_MUTEX */
diff --git a/netware/Makefile.am b/netware/Makefile.am
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/netware/Makefile.am
diff --git a/netware/netware.patch b/netware/netware.patch
new file mode 100644
index 00000000000..2dcf36a2d9c
--- /dev/null
+++ b/netware/netware.patch
@@ -0,0 +1,4162 @@
+*** mysql-4.0.7-gamma/ltmain.sh Fri Dec 20 07:25:10 2002
+--- mysql40/ltmain.sh Mon Jan 6 09:26:55 2003
+***************
+*** 49,62 ****
+ fi
+
+ # The name of this program.
+! progname=`$echo "$0" | sed 's%^.*/%%'`
+ modename="$progname"
+
+ # Constants.
+ PROGRAM=ltmain.sh
+ PACKAGE=libtool
+! VERSION=1.4.2
+! TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)"
+
+ default_mode=
+ help="Try \`$progname --help' for more information."
+--- 49,62 ----
+ fi
+
+ # The name of this program.
+! progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+ modename="$progname"
+
+ # Constants.
+ PROGRAM=ltmain.sh
+ PACKAGE=libtool
+! VERSION=1.4e
+! TIMESTAMP=" (1.1125 2002/06/26 07:15:36)"
+
+ default_mode=
+ help="Try \`$progname --help' for more information."
+***************
+*** 67,76 ****
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+! Xsed='sed -e 1s/^X//'
+ sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+! SP2NL='tr \040 \012'
+! NL2SP='tr \015\012 \040\040'
+
+ # NLS nuisances.
+ # Only set LANG and LC_ALL to C if already set.
+--- 67,85 ----
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+! Xsed="${SED}"' -e 1s/^X//'
+ sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+! # test EBCDIC or ASCII
+! case `echo A|od -x` in
+! *[Cc]1*) # EBCDIC based system
+! SP2NL="tr '\100' '\n'"
+! NL2SP="tr '\r\n' '\100\100'"
+! ;;
+! *) # Assume ASCII based system
+! SP2NL="tr '\040' '\012'"
+! NL2SP="tr '\015\012' '\040\040'"
+! ;;
+! esac
+
+ # NLS nuisances.
+ # Only set LANG and LC_ALL to C if already set.
+***************
+*** 106,112 ****
+ o2lo="s/\\.${objext}\$/.lo/"
+
+ # Parse our command line options once, thoroughly.
+! while test $# -gt 0
+ do
+ arg="$1"
+ shift
+--- 115,121 ----
+ o2lo="s/\\.${objext}\$/.lo/"
+
+ # Parse our command line options once, thoroughly.
+! while test "$#" -gt 0
+ do
+ arg="$1"
+ shift
+***************
+*** 122,127 ****
+--- 131,163 ----
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
++ tag)
++ tagname="$arg"
++
++ # Check whether tagname contains only valid characters
++ case $tagname in
++ *[!-_A-Za-z0-9,/]*)
++ echo "$progname: invalid tag name: $tagname" 1>&2
++ exit 1
++ ;;
++ esac
++
++ case $tagname in
++ CC)
++ # Don't test for the "default" C tag, as we know, it's there, but
++ # not specially marked.
++ ;;
++ *)
++ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
++ taglist="$taglist $tagname"
++ # Evaluate the configuration.
++ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
++ else
++ echo "$progname: ignoring unknown tag $tagname" 1>&2
++ fi
++ ;;
++ esac
++ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+***************
+*** 140,150 ****
+
+ --version)
+ echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ exit 0
+ ;;
+
+ --config)
+! sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ exit 0
+ ;;
+
+--- 176,195 ----
+
+ --version)
+ echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
++ echo
++ echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
++ echo "Free Software Foundation, Inc."
++ echo "This is free software; see the source for copying conditions. There is NO"
++ echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit 0
+ ;;
+
+ --config)
+! ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+! # Now print the configurations for the tags.
+! for tagname in $taglist; do
+! ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+! done
+ exit 0
+ ;;
+
+***************
+*** 177,186 ****
+--- 222,240 ----
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
++ --preserve-dup-deps) duplicate_deps="yes" ;;
++
+ --quiet | --silent)
+ show=:
+ ;;
+
++ --tag) prevopt="--tag" prev=tag ;;
++ --tag=*)
++ set tag "$optarg" ${1+"$@"}
++ shift
++ prev=tag
++ ;;
++
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+***************
+*** 270,317 ****
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+! prev=
+! lastarg=
+! srcfile="$nonopt"
+ suppress_output=
+
+- user_target=no
+ for arg
+ do
+! case $prev in
+! "") ;;
+! xcompiler)
+! # Aesthetically quote the previous argument.
+! prev=
+! lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+!
+! case $arg in
+! # Double-quote args containing other shell metacharacters.
+! # Many Bourne shells cannot handle close brackets correctly
+! # in scan sets, so we specify it separately.
+! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+! arg="\"$arg\""
+ ;;
+- esac
+
+! # Add the previous argument to base_compile.
+! if test -z "$base_compile"; then
+! base_compile="$lastarg"
+! else
+! base_compile="$base_compile $lastarg"
+! fi
+ continue
+ ;;
+- esac
+
+ # Accept any command-line options.
+ case $arg in
+ -o)
+! if test "$user_target" != "no"; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+! user_target=next
+ ;;
+
+ -static)
+--- 324,359 ----
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+! srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_output=
++ arg_mode=normal
++ libobj=
+
+ for arg
+ do
+! case "$arg_mode" in
+! arg )
+! # do not "continue". Instead, add this to base_compile
+! lastarg="$arg"
+! arg_mode=normal
+ ;;
+
+! target )
+! libobj="$arg"
+! arg_mode=normal
+ continue
+ ;;
+
++ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+! if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+! arg_mode=target
+! continue
+ ;;
+
+ -static)
+***************
+*** 330,338 ****
+ ;;
+
+ -Xcompiler)
+! prev=xcompiler
+! continue
+! ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+--- 372,380 ----
+ ;;
+
+ -Xcompiler)
+! arg_mode=arg # the next one goes into the "base_compile" arg list
+! continue # The current "srcfile" will either be retained or
+! ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+***************
+*** 355,427 ****
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+- if test -z "$base_compile"; then
+- base_compile="$lastarg"
+- else
+ base_compile="$base_compile $lastarg"
+- fi
+ continue
+ ;;
+- esac
+-
+- case $user_target in
+- next)
+- # The next one is the -o target name
+- user_target=yes
+- continue
+- ;;
+- yes)
+- # We got the output file
+- user_target=set
+- libobj="$arg"
+- continue
+- ;;
+- esac
+
+ # Accept the current argument as the source file.
+ lastarg="$srcfile"
+ srcfile="$arg"
+
+ # Aesthetically quote the previous argument.
+-
+- # Backslashify any backslashes, double quotes, and dollar signs.
+- # These are the only characters that are still specially
+- # interpreted inside of double-quoted scrings.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+- case $lastarg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+- # Add the previous argument to base_compile.
+- if test -z "$base_compile"; then
+- base_compile="$lastarg"
+- else
+ base_compile="$base_compile $lastarg"
+! fi
+! done
+
+! case $user_target in
+! set)
+! ;;
+! no)
+! # Get the name of the library object.
+! libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+! *)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+! xform='[cCFSfmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+--- 397,450 ----
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
++ * )
+ # Accept the current argument as the source file.
++ # The previous "srcfile" becomes the current argument.
++ #
+ lastarg="$srcfile"
+ srcfile="$arg"
++ ;;
++ esac # case $arg
++ ;;
++ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
++ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+! done # for arg
+
+! case $arg_mode in
+! arg)
+! $echo "$modename: you must specify an argument for -Xcompile"
+! exit 1
+ ;;
+! target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
++ *)
++ # Get the name of the library object.
++ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
++ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+! xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+***************
+*** 429,438 ****
+--- 452,464 ----
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
++ *.ii) xform=ii ;;
++ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
++ *.java) xform=java ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+***************
+*** 445,450 ****
+--- 471,526 ----
+ ;;
+ esac
+
++ # Infer tagged configuration to use if any are available and
++ # if one wasn't chosen via the "--tag" command line option.
++ # Only attempt this if the compiler in the base compile
++ # command doesn't match the default compiler.
++ if test -n "$available_tags" && test -z "$tagname"; then
++ case $base_compile in
++ # Blanks in the command may have been stripped by the calling shell,
++ # but not from the CC environment variable when ltconfig was run.
++ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
++ # Blanks at the start of $base_compile will cause this to fail
++ # if we don't check for them as well.
++ *)
++ for z in $available_tags; do
++ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
++ # Evaluate the configuration.
++ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
++ case "$base_compile " in
++ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
++ # The compiler in the base compile command matches
++ # the one in the tagged configuration.
++ # Assume this is the tagged configuration we want.
++ tagname=$z
++ break
++ ;;
++ esac
++ fi
++ done
++ # If $tagname still isn't set, then no tagged configuration
++ # was found and let the user know that the "--tag" command
++ # line option must be used.
++ if test -z "$tagname"; then
++ echo "$modename: unable to infer tagged configuration"
++ echo "$modename: specify a tag with \`--tag'" 1>&2
++ exit 1
++ # else
++ # echo "$modename: using $tagname tagged configuration"
++ fi
++ ;;
++ esac
++ fi
++
++ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
++ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$obj"; then
++ xdir=
++ else
++ xdir=$xdir/
++ fi
++ lobj=${xdir}$objdir/$objname
++
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+***************
+*** 453,461 ****
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+! removelist="$obj $libobj"
+ else
+! removelist="$libobj"
+ fi
+
+ $run $rm $removelist
+--- 529,537 ----
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+! removelist="$obj $lobj $libobj ${libobj}T"
+ else
+! removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+***************
+*** 467,473 ****
+ pic_mode=default
+ ;;
+ esac
+! if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+--- 543,549 ----
+ pic_mode=default
+ ;;
+ esac
+! if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+***************
+*** 480,485 ****
+--- 556,562 ----
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
++ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+***************
+*** 514,562 ****
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+! # All platforms use -DPIC, to notify preprocessed assembler code.
+! command="$base_compile $srcfile $pic_flag -DPIC"
+ else
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ fi
+- if test "$build_old_libs" = yes; then
+- lo_libobj="$libobj"
+- dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$dir" = "X$libobj"; then
+- dir="$objdir"
+- else
+- dir="$dir/$objdir"
+- fi
+- libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+
+! if test -d "$dir"; then
+! $show "$rm $libobj"
+! $run $rm $libobj
+! else
+! $show "$mkdir $dir"
+! $run $mkdir $dir
+ status=$?
+! if test $status -ne 0 && test ! -d $dir; then
+ exit $status
+ fi
+ fi
+! fi
+! if test "$compiler_o_lo" = yes; then
+! output_obj="$libobj"
+! command="$command -o $output_obj"
+! elif test "$compiler_c_o" = yes; then
+! output_obj="$obj"
+! command="$command -o $output_obj"
+ fi
+
+! $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+--- 591,638 ----
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
++ $run $rm "$libobj" "${libobj}T"
++
++ # Create a libtool object file (analogous to a ".la" file),
++ # but don't create it if we're doing a dry run.
++ test -z "$run" && cat > ${libobj}T <<EOF
++ # $libobj - a libtool object file
++ # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
++ #
++ # Please DO NOT delete this file!
++ # It is necessary for linking the library.
++
++ # Name of the PIC object.
++ EOF
++
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+! command="$base_compile $srcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ fi
+
+! if test ! -d "${xdir}$objdir"; then
+! $show "$mkdir ${xdir}$objdir"
+! $run $mkdir ${xdir}$objdir
+ status=$?
+! if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
+ fi
+ fi
+!
+! if test -z "$output_obj"; then
+! # Place PIC objects in $objdir
+! command="$command -o $lobj"
+ fi
+
+! $run $rm "$lobj" "$output_obj"
+!
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+***************
+*** 565,571 ****
+ fi
+
+ if test "$need_locks" = warn &&
+! test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+ *** ERROR, $lockfile contains:
+ `cat $lockfile 2>/dev/null`
+--- 641,647 ----
+ fi
+
+ if test "$need_locks" = warn &&
+! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ echo "\
+ *** ERROR, $lockfile contains:
+ `cat $lockfile 2>/dev/null`
+***************
+*** 585,593 ****
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+! if test x"$output_obj" != x"$libobj"; then
+! $show "$mv $output_obj $libobj"
+! if $run $mv $output_obj $libobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+--- 661,669 ----
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+! if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+! $show "$mv $output_obj $lobj"
+! if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+***************
+*** 595,642 ****
+ fi
+ fi
+
+! # If we have no pic_flag, then copy the object into place and finish.
+! if (test -z "$pic_flag" || test "$pic_mode" != default) &&
+! test "$build_old_libs" = yes; then
+! # Rename the .lo from within objdir to obj
+! if test -f $obj; then
+! $show $rm $obj
+! $run $rm $obj
+! fi
+
+! $show "$mv $libobj $obj"
+! if $run $mv $libobj $obj; then :
+! else
+! error=$?
+! $run $rm $removelist
+! exit $error
+! fi
+!
+! xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+! if test "X$xdir" = "X$obj"; then
+! xdir="."
+! else
+! xdir="$xdir"
+! fi
+! baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
+! libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+! # Now arrange that obj and lo_libobj become the same file
+! $show "(cd $xdir && $LN_S $baseobj $libobj)"
+! if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
+! # Unlock the critical section if it was locked
+! if test "$need_locks" != no; then
+! $run $rm "$lockfile"
+! fi
+! exit 0
+! else
+! error=$?
+! $run $rm $removelist
+! exit $error
+! fi
+! fi
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+--- 671,691 ----
+ fi
+ fi
+
+! # Append the name of the PIC object to the libtool object file.
+! test -z "$run" && cat >> ${libobj}T <<EOF
+! pic_object='$objdir/$objname'
+
+! EOF
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
++ else
++ # No PIC object so indicate it doesn't exist in the libtool
++ # object file.
++ test -z "$run" && cat >> ${libobj}T <<EOF
++ pic_object=none
++
++ EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+***************
+*** 645,661 ****
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ else
+! # All platforms use -DPIC, to notify preprocessed assembler code.
+! command="$base_compile $srcfile $pic_flag -DPIC"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+- output_obj="$obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+! $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+--- 694,708 ----
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ else
+! command="$base_compile $srcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+! $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+***************
+*** 664,670 ****
+ fi
+
+ if test "$need_locks" = warn &&
+! test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+ *** ERROR, $lockfile contains:
+ `cat $lockfile 2>/dev/null`
+--- 711,717 ----
+ fi
+
+ if test "$need_locks" = warn &&
+! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ echo "\
+ *** ERROR, $lockfile contains:
+ `cat $lockfile 2>/dev/null`
+***************
+*** 684,690 ****
+ fi
+
+ # Just move the object if needed
+! if test x"$output_obj" != x"$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+--- 731,737 ----
+ fi
+
+ # Just move the object if needed
+! if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+***************
+*** 694,716 ****
+ fi
+ fi
+
+! # Create an invalid libtool object if no PIC, so that we do not
+! # accidentally link it into a program.
+! if test "$build_libtool_libs" != yes; then
+! $show "echo timestamp > $libobj"
+! $run eval "echo timestamp > \$libobj" || exit $?
+! else
+! # Move the .lo from within objdir
+! $show "$mv $libobj $lo_libobj"
+! if $run $mv $libobj $lo_libobj; then :
+ else
+! error=$?
+! $run $rm $removelist
+! exit $error
+! fi
+! fi
+ fi
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+--- 741,765 ----
+ fi
+ fi
+
+! # Append the name of the non-PIC object the libtool object file.
+! # Only append if the libtool object file exists.
+! test -z "$run" && cat >> ${libobj}T <<EOF
+! # Name of the non-PIC object.
+! non_pic_object='$objname'
+!
+! EOF
+ else
+! # Append the name of the non-PIC object the libtool object file.
+! # Only append if the libtool object file exists.
+! test -z "$run" && cat >> ${libobj}T <<EOF
+! # Name of the non-PIC object.
+! non_pic_object=none
+!
+! EOF
+ fi
+
++ $run $mv "${libobj}T" "${libobj}"
++
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+***************
+*** 742,747 ****
+--- 791,797 ----
+ ;;
+ esac
+ libtool_args="$nonopt"
++ base_compile="$nonopt"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+***************
+*** 771,776 ****
+--- 821,827 ----
+ module=no
+ no_install=no
+ objs=
++ non_pic_objects=
+ prefer_static_libs=no
+ preload=no
+ prev=
+***************
+*** 812,819 ****
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+! while test $# -gt 0; do
+ arg="$1"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+--- 863,871 ----
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+! while test "$#" -gt 0; do
+ arg="$1"
++ base_compile="$base_compile $arg"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+***************
+*** 892,897 ****
+--- 944,1056 ----
+ prev=
+ continue
+ ;;
++ objectlist)
++ if test -f "$arg"; then
++ save_arg=$arg
++ moreargs=
++ for fil in `cat $save_arg`
++ do
++ # moreargs="$moreargs $fil"
++ arg=$fil
++ # A libtool-controlled object.
++
++ # Check to see that this really is a libtool object.
++ if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
++ pic_object=
++ non_pic_object=
++
++ # Read the .lo file
++ # If there is no directory component, then add one.
++ case $arg in
++ */* | *\\*) . $arg ;;
++ *) . ./$arg ;;
++ esac
++
++ if test -z "$pic_object" || \
++ test -z "$non_pic_object" ||
++ test "$pic_object" = none && \
++ test "$non_pic_object" = none; then
++ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
++ exit 1
++ fi
++
++ # Extract subdirectory from the argument.
++ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$arg"; then
++ xdir=
++ else
++ xdir="$xdir/"
++ fi
++
++ if test "$pic_object" != none; then
++ # Prepend the subdirectory the object is found in.
++ pic_object="$xdir$pic_object"
++
++ if test "$prev" = dlfiles; then
++ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
++ dlfiles="$dlfiles $pic_object"
++ prev=
++ continue
++ else
++ # If libtool objects are unsupported, then we need to preload.
++ prev=dlprefiles
++ fi
++ fi
++
++ # CHECK ME: I think I busted this. -Ossama
++ if test "$prev" = dlprefiles; then
++ # Preload the old-style object.
++ dlprefiles="$dlprefiles $pic_object"
++ prev=
++ fi
++
++ # A PIC object.
++ libobjs="$libobjs $pic_object"
++ arg="$pic_object"
++ fi
++
++ # Non-PIC object.
++ if test "$non_pic_object" != none; then
++ # Prepend the subdirectory the object is found in.
++ non_pic_object="$xdir$non_pic_object"
++
++ # A standard non-PIC object
++ non_pic_objects="$non_pic_objects $non_pic_object"
++ if test -z "$pic_object" || test "$pic_object" = none ; then
++ arg="$non_pic_object"
++ fi
++ fi
++ else
++ # Only an error if not doing a dry-run.
++ if test -z "$run"; then
++ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
++ exit 1
++ else
++ # Dry-run case.
++
++ # Extract subdirectory from the argument.
++ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
++ if test "X$xdir" = "X$arg"; then
++ xdir=
++ else
++ xdir="$xdir/"
++ fi
++
++ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
++ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
++ libobjs="$libobjs $pic_object"
++ non_pic_objects="$non_pic_objects $non_pic_object"
++ fi
++ fi
++ done
++ else
++ $echo "$modename: link input file \`$save_arg' does not exist"
++ exit 1
++ fi
++ arg=$save_arg
++ prev=
++ continue
++ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+***************
+*** 936,945 ****
+ continue
+ ;;
+ esac
+! fi # test -n $prev
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+--- 1095,1122 ----
+ continue
+ ;;
+ esac
+! fi # test -n "$prev"
+
+ prevarg="$arg"
+
++ # Pass Metrowerks x86 NLM linker flags to linker.
++ case "$LD" in
++ mwldnlm)
++ case "$arg" in
++ -check | -commandfile | -entry | -exit | -flags | -map)
++ linker_flags="$linker_flags $qarg"
++ prev=xlinker
++ ;;
++ -nocheck | -zerobss | -nozerobss)
++ linker_flags="$linker_flags $qarg"
++ ;;
++ -g)
++ # If -g then include symbols for NetWare internal debugger
++ linker_flags="$linker_flags -sym internal"
++ ;;
++ esac
++ ;;
++ esac
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+***************
+*** 992,998 ****
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+! no/*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+--- 1169,1175 ----
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+! no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+***************
+*** 1043,1056 ****
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+! *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+! *-*-openbsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+--- 1220,1237 ----
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+! *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
++ *-*-rhapsody* | *-*-darwin1.[012])
++ # Rhapsody C and math libraries are in the System framework
++ deplibs="$deplibs -framework System"
++ continue
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+! *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+***************
+*** 1089,1094 ****
+--- 1270,1280 ----
+ continue
+ ;;
+
++ -objectlist)
++ prev=objectlist
++ continue
++ ;;
++
+ -o) prev=output ;;
+
+ -release)
+***************
+*** 1201,1212 ****
+ esac
+ ;;
+
+! *.lo | *.$objext)
+! # A library or standard object.
+ if test "$prev" = dlfiles; then
+- # This file was specified with -dlopen.
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+! dlfiles="$dlfiles $arg"
+ prev=
+ continue
+ else
+--- 1387,1435 ----
+ esac
+ ;;
+
+! *.$objext)
+! # A standard object.
+! objs="$objs $arg"
+! ;;
+!
+! *.lo)
+! # A libtool-controlled object.
+!
+! # Check to see that this really is a libtool object.
+! if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+! pic_object=
+! non_pic_object=
+!
+! # Read the .lo file
+! # If there is no directory component, then add one.
+! case $arg in
+! */* | *\\*) . $arg ;;
+! *) . ./$arg ;;
+! esac
+!
+! if test -z "$pic_object" || \
+! test -z "$non_pic_object" ||
+! test "$pic_object" = none && \
+! test "$non_pic_object" = none; then
+! $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+! exit 1
+! fi
+!
+! # Extract subdirectory from the argument.
+! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+! if test "X$xdir" = "X$arg"; then
+! xdir=
+! else
+! xdir="$xdir/"
+! fi
+!
+! if test "$pic_object" != none; then
+! # Prepend the subdirectory the object is found in.
+! pic_object="$xdir$pic_object"
+!
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+! dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+***************
+*** 1215,1229 ****
+ fi
+ fi
+
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+! dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
+ prev=
+ else
+! case $arg in
+! *.lo) libobjs="$libobjs $arg" ;;
+! *) objs="$objs $arg" ;;
+! esac
+ fi
+ ;;
+
+--- 1438,1487 ----
+ fi
+ fi
+
++ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+! dlprefiles="$dlprefiles $pic_object"
+ prev=
++ fi
++
++ # A PIC object.
++ libobjs="$libobjs $pic_object"
++ arg="$pic_object"
++ fi
++
++ # Non-PIC object.
++ if test "$non_pic_object" != none; then
++ # Prepend the subdirectory the object is found in.
++ non_pic_object="$xdir$non_pic_object"
++
++ # A standard non-PIC object
++ non_pic_objects="$non_pic_objects $non_pic_object"
++ if test -z "$pic_object" || test "$pic_object" = none ; then
++ arg="$non_pic_object"
++ fi
++ fi
+ else
+! # Only an error if not doing a dry-run.
+! if test -z "$run"; then
+! $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+! exit 1
+! else
+! # Dry-run case.
+!
+! # Extract subdirectory from the argument.
+! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+! if test "X$xdir" = "X$arg"; then
+! xdir=
+! else
+! xdir="$xdir/"
+! fi
+!
+! pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+! non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+! libobjs="$libobjs $pic_object"
+! non_pic_objects="$non_pic_objects $non_pic_object"
+! fi
+ fi
+ ;;
+
+***************
+*** 1277,1288 ****
+--- 1535,1617 ----
+ exit 1
+ fi
+
++ # Special handling for Metrowerks compiler for NetWare
++ case "$LD" in
++ mwldnlm)
++ # If building debug (-g) add internal debug symbols.
++ compile_command=`echo $compile_command | ${SED} -e 's/ -g / -g -sym internal /'`
++
++ # When using the Metrowerks linker for NetWare, if there is a
++ # .def or .exp file with the same filename as the $output file,
++ # add it as a -commandfile to $compile_command and $linker_flags
++ # (if no -commandfile yet)
++ base=`echo $output | ${SED} 's,\(.*\)\..*$,\1,'`
++ cmd_file=
++ for ext in def exp; do
++ if test -f "$base.$ext"; then
++ cmd_file="$base.$ext"
++ break
++ fi
++ done
++ if test -n "$cmd_file"; then
++ if ! ( expr "$compile_command" : ".*-commandfile.*" > /dev/null ); then
++ compile_command="$compile_command -commandfile $cmd_file"
++ fi
++ if ! ( expr "$linker_flags" : ".*-commandfile.*" > /dev/null ); then
++ linker_flags="$linker_flags -commandfile $cmd_file"
++ fi
++ fi
++ ;;
++ esac
++
++ # Infer tagged configuration to use if any are available and
++ # if one wasn't chosen via the "--tag" command line option.
++ # Only attempt this if the compiler in the base link
++ # command doesn't match the default compiler.
++ if test -n "$available_tags" && test -z "$tagname"; then
++ case $base_compile in
++ # Blanks in the command may have been stripped by the calling shell,
++ # but not from the CC environment variable when ltconfig was run.
++ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
++ # Blanks at the start of $base_compile will cause this to fail
++ # if we don't check for them as well.
++ *)
++ for z in $available_tags; do
++ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
++ # Evaluate the configuration.
++ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
++ case $base_compile in
++ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
++ # The compiler in $compile_command matches
++ # the one in the tagged configuration.
++ # Assume this is the tagged configuration we want.
++ tagname=$z
++ break
++ ;;
++ esac
++ fi
++ done
++ # If $tagname still isn't set, then no tagged configuration
++ # was found and let the user know that the "--tag" command
++ # line option must be used.
++ if test -z "$tagname"; then
++ echo "$modename: unable to infer tagged configuration"
++ echo "$modename: specify a tag with \`--tag'" 1>&2
++ exit 1
++ # else
++ # echo "$modename: using $tagname tagged configuration"
++ fi
++ ;;
++ esac
++ fi
++
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
++ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+***************
+*** 1303,1313 ****
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+! if test ! -d $output_objdir; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+! if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+--- 1632,1642 ----
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+! if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $status
+ fi
+ fi
+***************
+*** 1325,1340 ****
+--- 1654,1713 ----
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
++ case $host in
++ *cygwin*)
++ # This is a hack, but we run into problems on cygwin.
++ # libgcc.a depends on libcygwin, but gcc puts -lgcc onto
++ # the link line twice: once before the "normal" libs
++ # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and
++ # once AFTER those. However, the "eliminate dup deps"
++ # proceedure keeps only the LAST duplicate -- thus
++ # messing up the order, since after dup elimination
++ # -lgcc comes AFTER -lcygwin. In normal C operation,
++ # you don't notice the problem, because -lgcc isn't
++ # really used. However, now that C++ libraries are
++ # libtool-able, you DO see the problem. So, it must
++ # be fixed. We could always force "--preserve-dup-deps"
++ # but that could lead to other problems. So, on cygwin,
++ # always preserve dups of -lgcc...but only -lgcc. That
++ # way, the dependency order won't get corrupted.
++ specialdeplibs="-lgcc"
++ ;;
++ *)
+ specialdeplibs=
++ ;;
++ esac
++
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
++ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
++ fi
+ libs="$libs $deplib"
+ done
++
++ if test "$linkmode" = lib; then
++ libs="$predeps $libs $compiler_lib_search_path $postdeps"
++
++ # Compute libraries that are listed more than once in $predeps
++ # $postdeps and mark them as special (i.e., whose duplicates are
++ # not to be eliminated).
++ pre_post_deps=
++ if test "X$duplicate_deps" = "Xyes" ; then
++ for pre_post_dep in $predeps $postdeps; do
++ case "$pre_post_deps " in
++ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
++ esac
++ pre_post_deps="$pre_post_deps $pre_post_dep"
++ done
++ fi
++ pre_post_deps=
++ fi
++
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+***************
+*** 1366,1393 ****
+ ;;
+ esac
+ for pass in $passes; do
+! if test $linkmode = prog; then
+! # Determine which files to process
+! case $pass in
+! dlopen)
+! libs="$dlfiles"
+! save_deplibs="$deplibs" # Collect dlpreopened libraries
+ deplibs=
+! ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -l*)
+! if test $linkmode = oldlib && test $linkmode = obj; then
+! $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
+ continue
+ fi
+! if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+--- 1739,1771 ----
+ ;;
+ esac
+ for pass in $passes; do
+! if test "$linkmode,$pass" = "lib,link" ||
+! test "$linkmode,$pass" = "prog,scan"; then
+! libs="$deplibs"
+ deplibs=
+! fi
+! if test "$linkmode" = prog; then
+! case $pass in
+! dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
++ if test "$pass" = dlopen; then
++ # Collect dlpreopened libraries
++ save_deplibs="$deplibs"
++ deplibs=
++ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -l*)
+! if test "$linkmode" != lib && test "$linkmode" != prog; then
+! $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+! if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+***************
+*** 1407,1413 ****
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+! test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+--- 1785,1791 ----
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+! test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+***************
+*** 1416,1431 ****
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+! test $pass = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+! if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+! if test $pass = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+--- 1794,1809 ----
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+! test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+! if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+! if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+***************
+*** 1434,1446 ****
+ fi
+ ;;
+ *)
+! $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+! if test $pass = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+--- 1812,1824 ----
+ fi
+ ;;
+ *)
+! $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+! if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+***************
+*** 1453,1459 ****
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+! if test $pass = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+--- 1831,1837 ----
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+! if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+***************
+*** 1461,1470 ****
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ echo
+! echo "*** Warning: This library needs some functionality provided by $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have."
+ else
+ echo
+ echo "*** Warning: Linking the shared library $output against the"
+--- 1839,1850 ----
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ echo
+! echo "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have"
+! echo "*** because the file extensions .$libext of this argument makes me believe"
+! echo "*** that it is just a static archive that I should not used here."
+ else
+ echo
+ echo "*** Warning: Linking the shared library $output against the"
+***************
+*** 1474,1480 ****
+ continue
+ ;;
+ prog)
+! if test $pass != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+--- 1854,1860 ----
+ continue
+ ;;
+ prog)
+! if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+***************
+*** 1485,1491 ****
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+! if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+--- 1865,1874 ----
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+! if test "$pass" = conv; then
+! deplibs="$deplib $deplibs"
+! elif test "$linkmode" = prog; then
+! if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+***************
+*** 1494,1499 ****
+--- 1877,1883 ----
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
++ fi
+ continue
+ ;;
+ %DEPLIBS%)
+***************
+*** 1501,1514 ****
+ continue
+ ;;
+ esac # case $deplib
+! if test $found = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # Check to see that this really is a libtool archive.
+! if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+--- 1885,1898 ----
+ continue
+ ;;
+ esac # case $deplib
+! if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # Check to see that this really is a libtool archive.
+! if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+***************
+*** 1535,1547 ****
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+! { test $linkmode = oldlib && test $linkmode = obj; }; then
+! # Add dl[pre]opened files of deplib
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+! if test $pass = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+--- 1919,1930 ----
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+! { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+! if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+***************
+*** 1555,1566 ****
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ tmp_libs="$tmp_libs $deplib"
+ done
+! elif test $linkmode != prog && test $linkmode != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+--- 1938,1951 ----
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
++ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+! elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+***************
+*** 1578,1592 ****
+ fi
+
+ # This library was specified with -dlopen.
+! if test $pass = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+! # statically, we need to preload.
+! dlprefiles="$dlprefiles $lib"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+--- 1963,1979 ----
+ fi
+
+ # This library was specified with -dlopen.
+! if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+! # statically, we need to preload. We also need to preload any
+! # dependent libraries so libltdl's deplib preloader doesn't
+! # bomb out in the load deplibs phase.
+! dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+***************
+*** 1627,1633 ****
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+! if test $pass = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+--- 2014,2020 ----
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+! if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+***************
+*** 1646,1663 ****
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+! if test $linkmode = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+! deplibs="$lib $deplibs"
+ fi
+ continue
+ fi
+
+! if test $linkmode = prog && test $pass != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+--- 2033,2050 ----
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+! if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+! deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+! if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+***************
+*** 1673,1700 ****
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+! if test $linkalldeplibs = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+! link_static=no # Whether the deplib will be linked statically
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+! # Link against this shared library
+
+- if test "$linkmode,$pass" = "prog,link" ||
+- { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+--- 2060,2095 ----
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+! if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
++ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+! if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+! # We need to hardcode the library path
+! if test -n "$shlibpath_var"; then
+! # Make sure the rpath contains only unique directories.
+! case "$temp_rpath " in
+! *" $dir "*) ;;
+! *" $absdir "*) ;;
+! *) temp_rpath="$temp_rpath $dir" ;;
+! esac
+! fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+***************
+*** 1716,1732 ****
+ esac
+ ;;
+ esac
+- if test $linkmode = prog; then
+- # We need to hardcode the library path
+- if test -n "$shlibpath_var"; then
+- # Make sure the rpath contains only unique directories.
+- case "$temp_rpath " in
+- *" $dir "*) ;;
+- *" $absdir "*) ;;
+- *) temp_rpath="$temp_rpath $dir" ;;
+- esac
+- fi
+- fi
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+--- 2111,2116 ----
+***************
+*** 1736,1746 ****
+--- 2120,2159 ----
+ # We only need to search for static libraries
+ continue
+ fi
++ fi
+
++ link_static=no # Whether the deplib will be linked statically
++ if test -n "$library_names" &&
++ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
++ # This is a shared library
++ if test "$linkmode" = lib &&
++ test "$hardcode_into_libs" = yes; then
++ # Hardcode the library path.
++ # Skip directories that are in the system default run-time
++ # search path.
++ case " $sys_lib_dlsearch_path " in
++ *" $absdir "*) ;;
++ *)
++ case "$compile_rpath " in
++ *" $absdir "*) ;;
++ *) compile_rpath="$compile_rpath $absdir"
++ esac
++ ;;
++ esac
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *)
++ case "$finalize_rpath " in
++ *" $libdir "*) ;;
++ *) finalize_rpath="$finalize_rpath $libdir"
++ esac
++ ;;
++ esac
++ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+***************
+*** 1766,1773 ****
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+! soname=`echo $soroot | sed -e 's/^.*\///'`
+! newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+--- 2179,2186 ----
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+! soname=`echo $soroot | ${SED} -e 's/^.*\///'`
+! newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+***************
+*** 1798,1806 ****
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+! fi # test -n $old_archive_from_expsyms_cmds
+
+! if test $linkmode = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+--- 2211,2219 ----
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+! fi # test -n "$old_archive_from_expsyms_cmds"
+
+! if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+***************
+*** 1808,1813 ****
+--- 2221,2229 ----
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
++ case $host in
++ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
++ esac
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+***************
+*** 1849,1855 ****
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+! if test $linkmode = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+--- 2265,2271 ----
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+! if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+***************
+*** 1866,1872 ****
+ fi
+ fi
+
+! if test $linkmode = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+--- 2282,2288 ----
+ fi
+ fi
+
+! if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+***************
+*** 1884,1898 ****
+ add="-l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+- if test "X$installed" = Xyes; then
+ add_dir="-L$libdir"
+- else
+- add_dir="-L$DESTDIR$libdir"
+- fi
+ add="-l$name"
+ fi
+
+! if test $linkmode = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+--- 2300,2310 ----
+ add="-l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ add="-l$name"
+ fi
+
+! if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+***************
+*** 1900,1915 ****
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+! elif test $linkmode = prog; then
+! if test "$alldeplibs" = yes &&
+! { test "$deplibs_check_method" = pass_all ||
+! { test "$build_libtool_libs" = yes &&
+! test -n "$library_names"; }; }; then
+! # We only need to search for static libraries
+! continue
+! fi
+!
+! # Try to link the static library
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+--- 2312,2318 ----
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+! elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+***************
+*** 1930,1942 ****
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+! echo "*** Warning: This library needs some functionality provided by $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+! echo "*** Therefore, libtool will create a static module, that should work "
+! echo "*** as long as the dlopening application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+--- 2333,2346 ----
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+! echo "*** Warning: This system can not link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+! echo "*** But as you try to build a module library, libtool will still create "
+! echo "*** a static module, that should work as long as the dlopening application"
+! echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+***************
+*** 1959,1968 ****
+ fi
+ fi # link shared/static library?
+
+! if test $linkmode = lib; then
+ if test -n "$dependency_libs" &&
+! { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
+! test $link_static = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+--- 2363,2372 ----
+ fi
+ fi # link shared/static library?
+
+! if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+! { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+! test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+***************
+*** 1985,1997 ****
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+! if test $link_all_deplibs != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+--- 2389,2403 ----
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
++ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
++ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+! if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+***************
+*** 2013,2019 ****
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="-L$absdir/$objdir"
+ else
+! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+--- 2419,2425 ----
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="-L$absdir/$objdir"
+ else
+! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+***************
+*** 2034,2048 ****
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+! if test $pass = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+! if test $pass != dlopen; then
+! test $pass != scan && dependency_libs="$newdependency_libs"
+! if test $pass != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+--- 2440,2454 ----
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+! dependency_libs="$newdependency_libs"
+! if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+! if test "$pass" != dlopen; then
+! if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+***************
+*** 2064,2072 ****
+--- 2470,2498 ----
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
++ # FIXME: Pedantically, this is the right thing to do, so
++ # that some nasty dependency loop isn't accidentally
++ # broken:
++ #new_libs="$deplib $new_libs"
++ # Pragmatically, this seems to cause very few problems in
++ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ *)
++ # And here is the reason: when a library appears more
++ # than once as an explicit dependence of a library, or
++ # is implicitly linked in more than once by the
++ # compiler, it is considered special, and multiple
++ # occurrences thereof are not removed. Compare this
++ # with having the same library being listed as a
++ # dependency of multiple other libraries: in this case,
++ # we know (pedantically, we assume) the library does not
++ # need to be listed more than once, so we keep only the
++ # last copy. This is not always right, but it is rare
++ # enough that we require users that really mean to play
++ # such unportable linking tricks to link the library
++ # using -Wl,-lname, so that libtool does not consider it
++ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+***************
+*** 2094,2112 ****
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+- if test "$pass" = "conv" &&
+- { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
+- libs="$deplibs" # reset libs
+- deplibs=
+- fi
+ done # for pass
+! if test $linkmode = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+--- 2520,2537 ----
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ done # for pass
+! if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
++ if test -n "$deplibs"; then
++ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
++ fi
++
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+***************
+*** 2177,2183 ****
+ fi
+
+ set dummy $rpath
+! if test $# -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+--- 2602,2608 ----
+ fi
+
+ set dummy $rpath
+! if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+***************
+*** 2186,2192 ****
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+! libext=al
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+--- 2611,2619 ----
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+! # Some compilers have problems with a `.al' extension so
+! # convenience libraries should have the same extension an
+! # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+***************
+*** 2244,2250 ****
+ ;;
+ esac
+
+! if test $age -gt $current; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+--- 2671,2677 ----
+ ;;
+ esac
+
+! if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+***************
+*** 2277,2292 ****
+ versuffix=".$current";
+ ;;
+
+! irix)
+ major=`expr $current - $age + 1`
+! verstring="sgi$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+! while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+! verstring="sgi$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+--- 2704,2724 ----
+ versuffix=".$current";
+ ;;
+
+! irix | nonstopux)
+ major=`expr $current - $age + 1`
+!
+! case $version_type in
+! nonstopux) verstring_prefix=nonstopux ;;
+! *) verstring_prefix=sgi ;;
+! esac
+! verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+! while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+! verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+***************
+*** 2306,2312 ****
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+! while test $loop != 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+--- 2738,2744 ----
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+! while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+***************
+*** 2338,2349 ****
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+- verstring="0.0"
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+! verstring=""
+ ;;
+ *)
+ verstring="0.0"
+--- 2770,2780 ----
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+! verstring=
+ ;;
+ *)
+ verstring="0.0"
+***************
+*** 2377,2385 ****
+ fi
+
+ if test "$mode" != relink; then
+! # Remove our outputs.
+! $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+! $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+ fi
+
+ # Now set the variables for building old libraries.
+--- 2808,2831 ----
+ fi
+
+ if test "$mode" != relink; then
+! # Remove our outputs, but don't remove object files since they
+! # may have been created when compiling PIC objects.
+! removelist=
+! tempremovelist=`echo "$output_objdir/*"`
+! for p in $tempremovelist; do
+! case $p in
+! *.$objext)
+! ;;
+! $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+! removelist="$removelist $p"
+! ;;
+! *) ;;
+! esac
+! done
+! if test -n "$removelist"; then
+! $show "${rm}r $removelist"
+! $run ${rm}r $removelist
+! fi
+ fi
+
+ # Now set the variables for building old libraries.
+***************
+*** 2392,2400 ****
+
+ # Eliminate all temporary directories.
+ for path in $notinst_path; do
+! lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
+! deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
+! dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
+ done
+
+ if test -n "$xrpath"; then
+--- 2838,2846 ----
+
+ # Eliminate all temporary directories.
+ for path in $notinst_path; do
+! lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+! deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+! dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
+ done
+
+ if test -n "$xrpath"; then
+***************
+*** 2407,2413 ****
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+! if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+--- 2853,2859 ----
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+! if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+***************
+*** 2445,2456 ****
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+! *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+! if test $build_libtool_need_lc = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+--- 2891,2903 ----
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+! *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
++ test "X$arg" = "X-lc" && continue
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+! if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+***************
+*** 2490,2502 ****
+ int main() { return 0; }
+ EOF
+ $rm conftest
+! $CC -o conftest conftest.c $deplibs
+! if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test -n "$name" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+--- 2937,2949 ----
+ int main() { return 0; }
+ EOF
+ $rm conftest
+! $LTCC -o conftest conftest.c $deplibs
+! if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test "$name" != "" && test "$name" -ne "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+***************
+*** 2506,2531 ****
+ else
+ droppeddeps=yes
+ echo
+! echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+! # Error occured in the first compile. Let's try to salvage the situation:
+! # Compile a seperate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test -n "$name" && test "$name" != "0"; then
+ $rm conftest
+! $CC -o conftest conftest.c $i
+ # Did it work?
+! if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+--- 2953,2980 ----
+ else
+ droppeddeps=yes
+ echo
+! echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which I believe you do not have"
+! echo "*** because a test_compile did reveal that the linker did not use it for"
+! echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+! # Error occured in the first compile. Let's try to salvage
+! # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+! $LTCC -o conftest conftest.c $i
+ # Did it work?
+! if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+***************
+*** 2536,2545 ****
+ else
+ droppeddeps=yes
+ echo
+! echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ droppeddeps=yes
+--- 2985,2996 ----
+ else
+ droppeddeps=yes
+ echo
+! echo "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have"
+! echo "*** because a test_compile did reveal that the linker did not use this one"
+! echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ else
+ droppeddeps=yes
+***************
+*** 2561,2567 ****
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test -n "$name" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+--- 3012,3018 ----
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+! if test "$name" != "" && test "$name" != "0"; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+***************
+*** 2578,2591 ****
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+! potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+! | sed 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+--- 3029,3042 ----
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+! potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+! | ${SED} 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+***************
+*** 2596,2605 ****
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+! echo "*** Warning: This library needs some functionality provided by $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ # Add a -L argument.
+--- 3047,3063 ----
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+! echo "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have"
+! echo "*** because I did check the linker path looking for a file starting"
+! if test -z "$potlib" ; then
+! echo "*** with $libname but no candidates were found. (...for file magic test)"
+! else
+! echo "*** with $libname and none of the candidates passed a file format test"
+! echo "*** using a file magic. Last file checked: $potlib"
+! fi
+ fi
+ else
+ # Add a -L argument.
+***************
+*** 2618,2625 ****
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ if eval echo \"$potent_lib\" 2>/dev/null \
+! | sed 10q \
+ | egrep "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+--- 3076,3084 ----
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
++ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval echo \"$potent_lib\" 2>/dev/null \
+! | ${SED} 10q \
+ | egrep "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+***************
+*** 2630,2639 ****
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+! echo "*** Warning: This library needs some functionality provided by $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ # Add a -L argument.
+--- 3089,3105 ----
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+! echo "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+! echo "*** shared version of the library, which you do not appear to have"
+! echo "*** because I did check the linker path looking for a file starting"
+! if test -z "$potlib" ; then
+! echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+! else
+! echo "*** with $libname and none of the candidates passed a file format test"
+! echo "*** using a regex pattern. Last file checked: $potlib"
+! fi
+ fi
+ else
+ # Add a -L argument.
+***************
+*** 2696,2702 ****
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+! if test $allow_undefined = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+--- 3162,3168 ----
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+! if test "$allow_undefined" = no; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+***************
+*** 2723,2729 ****
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+! if test $hardcode_into_libs = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+--- 3189,3195 ----
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+! if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+***************
+*** 2789,2795 ****
+ else
+ soname="$realname"
+ fi
+! test -z "$dlname" && dlname=$soname
+
+ lib="$output_objdir/$realname"
+ for link
+--- 3255,3263 ----
+ else
+ soname="$realname"
+ fi
+! if test -z "$dlname"; then
+! dlname=$soname
+! fi
+
+ lib="$output_objdir/$realname"
+ for link
+***************
+*** 2797,2819 ****
+ linknames="$linknames $link"
+ done
+
+- # Ensure that we have .o objects for linkers which dislike .lo
+- # (e.g. aix) in case we are running --disable-static
+- for obj in $libobjs; do
+- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$xdir" = "X$obj"; then
+- xdir="."
+- else
+- xdir="$xdir"
+- fi
+- baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+- if test ! -f $xdir/$oldobj; then
+- $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+- $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
+- fi
+- done
+-
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+--- 3265,3270 ----
+***************
+*** 2827,2834 ****
+--- 3278,3293 ----
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
++ if len=`expr "X$cmd" : ".*"` &&
++ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
++ skipped_export=false
++ else
++ # The command line is too long to execute in one step.
++ $show "using reloadable object file for export list..."
++ skipped_export=:
++ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+***************
+*** 2846,2860 ****
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "mkdir $gentop"
+! $run mkdir "$gentop"
+ status=$?
+! if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+--- 3305,3320 ----
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
++ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "$mkdir $gentop"
+! $run $mkdir "$gentop"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+***************
+*** 2870,2885 ****
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "mkdir $xdir"
+! $run mkdir "$xdir"
+ status=$?
+! if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+! libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+--- 3330,3345 ----
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "$mkdir $xdir"
+! $run $mkdir "$xdir"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+! libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+***************
+*** 2898,2905 ****
+--- 3358,3488 ----
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
++ save_deplibs="$deplibs"
++ for conv in $convenience; do
++ tmp_deplibs=
++ for test_deplib in $deplibs; do
++ if test "$test_deplib" != "$conv"; then
++ tmp_deplibs="$tmp_deplibs $test_deplib"
++ fi
++ done
++ deplibs="$tmp_deplibs"
++ done
++ eval cmds=\"$archive_cmds\"
++ deplibs="$save_deplibs"
++ fi
++
++ if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
++ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
++ :
++ else
++ # The command line is too long to link in one step, link piecewise.
++ $echo "creating reloadable object files..."
++
++ # Save the value of $output and $libobjs because we want to
++ # use them later. If we have whole_archive_flag_spec, we
++ # want to use save_libobjs as it was before
++ # whole_archive_flag_spec was expanded, because we can't
++ # assume the linker understands whole_archive_flag_spec.
++ # This may have to be revisited, in case too many
++ # convenience libraries get linked in and end up exceeding
++ # the spec.
++ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
++ save_libobjs=$libobjs
++ fi
++ save_output=$output
++
++ # Clear the reloadable object creation command queue and
++ # initialize k to one.
++ test_cmds=
++ concat_cmds=
++ objlist=
++ delfiles=
++ last_robj=
++ k=1
++ output=$output_objdir/$save_output-${k}.$objext
++ # Loop over the list of objects to be linked.
++ for obj in $save_libobjs
++ do
++ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
++ if test "X$objlist" = X ||
++ { len=`expr "X$test_cmds" : ".*"` &&
++ test "$len" -le "$max_cmd_len"; }; then
++ objlist="$objlist $obj"
++ else
++ # The command $test_cmds is almost too long, add a
++ # command to the queue.
++ if test "$k" -eq 1 ; then
++ # The first file doesn't have a previous command to add.
++ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
++ else
++ # All subsequent reloadable object files will link in
++ # the last one created.
++ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
++ fi
++ last_robj=$output_objdir/$save_output-${k}.$objext
++ k=`expr $k + 1`
++ output=$output_objdir/$save_output-${k}.$objext
++ objlist=$obj
++ len=1
++ fi
++ done
++ # Handle the remaining objects by creating one last
++ # reloadable object file. All subsequent reloadable object
++ # files will link in the last one created.
++ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
++ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
++
++ if ${skipped_export-false}; then
++ $show "generating symbol list for \`$libname.la'"
++ export_symbols="$output_objdir/$libname.exp"
++ $run $rm $export_symbols
++ libobjs=$output
++ # Append the command to create the export file.
++ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
++ fi
++
++ # Set up a command to remove the reloadale object files
++ # after they are used.
++ i=0
++ while test "$i" -lt "$k"
++ do
++ i=`expr $i + 1`
++ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
++ done
++
++ $echo "creating a temporary reloadable object file: $output"
++
++ # Loop through the commands generated above and execute them.
++ save_ifs="$IFS"; IFS='~'
++ for cmd in $concat_cmds; do
++ IFS="$save_ifs"
++ $show "$cmd"
++ $run eval "$cmd" || exit $?
++ done
++ IFS="$save_ifs"
++
++ libobjs=$output
++ # Restore the value of output.
++ output=$save_output
++
++ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
++ fi
++ # Expand the library linking commands again to reset the
++ # value of $libobjs for piecewise linking.
++
++ # Do each of the archive commands.
++ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
++ eval cmds=\"$archive_expsym_cmds\"
++ else
+ eval cmds=\"$archive_cmds\"
+ fi
++
++ # Append the command to remove the reloadable object files
++ # to the just-reset $cmds.
++ eval cmds=\"\$cmds~$rm $delfiles\"
++ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+***************
+*** 2990,2999 ****
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "mkdir $gentop"
+! $run mkdir "$gentop"
+ status=$?
+! if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+--- 3573,3582 ----
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "$mkdir $gentop"
+! $run $mkdir "$gentop"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+***************
+*** 3009,3024 ****
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "mkdir $xdir"
+! $run mkdir "$xdir"
+ status=$?
+! if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+! reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+--- 3592,3607 ----
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "$mkdir $xdir"
+! $run $mkdir "$xdir"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+! reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+***************
+*** 3054,3061 ****
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+! $show "echo timestamp > $libobj"
+! $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+--- 3637,3644 ----
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+! # $show "echo timestamp > $libobj"
+! # $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+***************
+*** 3071,3090 ****
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+- else
+- # Just create a symlink.
+- $show $rm $libobj
+- $run $rm $libobj
+- xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+- if test "X$xdir" = "X$libobj"; then
+- xdir="."
+- else
+- xdir="$xdir"
+- fi
+- baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+- $show "(cd $xdir && $LN_S $oldobj $baseobj)"
+- $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
+ fi
+
+ if test -n "$gentop"; then
+--- 3654,3659 ----
+***************
+*** 3097,3103 ****
+
+ prog)
+ case $host in
+! *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+--- 3666,3672 ----
+
+ prog)
+ case $host in
+! *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+***************
+*** 3285,3293 ****
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+! $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+! $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+--- 3854,3862 ----
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+! $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+! $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+***************
+*** 3295,3301 ****
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+! name=`echo "$arg" | sed -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+--- 3864,3870 ----
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+! name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+***************
+*** 3310,3316 ****
+ fi
+
+ # Try sorting and uniquifying the output.
+! if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+--- 3879,3891 ----
+ fi
+
+ # Try sorting and uniquifying the output.
+! if grep -v "^: " < "$nlist" |
+! if sort -k 3 </dev/null >/dev/null 2>&1; then
+! sort -k 3
+! else
+! sort +2
+! fi |
+! uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+***************
+*** 3371,3388 ****
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+! *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+! *) pic_flag_for_symtable=" $pic_flag -DPIC";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+! $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+! $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+--- 3946,3963 ----
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+! *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+! *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+! $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+! $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+***************
+*** 3407,3413 ****
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+! if test $need_relink = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+--- 3982,3988 ----
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+! if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+***************
+*** 3532,3538 ****
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+! relink_command="cd `pwd`; $relink_command"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+--- 4107,4113 ----
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+! relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+***************
+*** 3552,3562 ****
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+! *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+! *cygwin*) exeext=.exe ;;
+ *) exeext= ;;
+ esac
+ $rm $output
+--- 4127,4139 ----
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+! *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+! *cygwin*)
+! exeext=.exe
+! outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ $rm $output
+***************
+*** 3576,3582 ****
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+! Xsed='sed -e 1s/^X//'
+ sed_quote_subst='$sed_quote_subst'
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+--- 4153,4159 ----
+
+ # Sed substitution that helps us do robust quoting. It backslashifies
+ # metacharacters that are still active within double-quoted strings.
+! Xsed='${SED} -e 1s/^X//'
+ sed_quote_subst='$sed_quote_subst'
+
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
+***************
+*** 3614,3620 ****
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+! file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+--- 4191,4197 ----
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+! file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+***************
+*** 3627,3633 ****
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+! file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+--- 4204,4210 ----
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+! file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+***************
+*** 3641,3647 ****
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+! { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+--- 4218,4224 ----
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+! { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+***************
+*** 3763,3769 ****
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+! oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ fi
+ addlibs="$old_convenience"
+ fi
+--- 4340,4346 ----
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+! oldobjs="$oldobjs$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+***************
+*** 3772,3781 ****
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "mkdir $gentop"
+! $run mkdir "$gentop"
+ status=$?
+! if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+--- 4349,4358 ----
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+! $show "$mkdir $gentop"
+! $run $mkdir "$gentop"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+***************
+*** 3792,3801 ****
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "mkdir $xdir"
+! $run mkdir "$xdir"
+ status=$?
+! if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+--- 4369,4378 ----
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+! $show "$mkdir $xdir"
+! $run $mkdir "$xdir"
+ status=$?
+! if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+***************
+*** 3809,3833 ****
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+! # Ensure that we have .o objects in place in case we decided
+! # not to build a shared library, and have fallen back to building
+! # static libs even though --disable-static was passed!
+! for oldobj in $oldobjs; do
+! if test ! -f $oldobj; then
+! xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+! if test "X$xdir" = "X$oldobj"; then
+! xdir="."
+! else
+! xdir="$xdir"
+! fi
+! baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+! obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+! $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+! $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+ fi
+ done
+!
+! eval cmds=\"$old_archive_cmds\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+--- 4386,4438 ----
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+! eval cmds=\"$old_archive_cmds\"
+!
+! if len=`expr "X$cmds" : ".*"` &&
+! test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+! :
+! else
+! # the command line is too long to link in one step, link in parts
+! $echo "using piecewise archive linking..."
+! save_RANLIB=$RANLIB
+! RANLIB=:
+! objlist=
+! concat_cmds=
+! save_oldobjs=$oldobjs
+! # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+! # encoded into archives. This makes 'ar r' malfunction in
+! # this piecewise linking case whenever conflicting object
+! # names appear in distinct ar calls; check, warn and compensate.
+! if (for obj in $save_oldobjs
+! do
+! $echo "X$obj" | $Xsed -e 's%^.*/%%'
+! done | sort | sort -uc >/dev/null 2>&1); then
+! :
+! else
+! $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+! $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+! AR_FLAGS=cq
+! fi
+! for obj in $save_oldobjs
+! do
+! oldobjs="$objlist $obj"
+! objlist="$objlist $obj"
+! eval test_cmds=\"$old_archive_cmds\"
+! if len=`expr "X$test_cmds" : ".*"` &&
+! test "$len" -le "$max_cmd_len"; then
+! :
+! else
+! # the above command should be used before it gets too long
+! oldobjs=$objlist
+! test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+! eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+! objlist=
+ fi
+ done
+! RANLIB=$save_RANLIB
+! oldobjs=$objlist
+! eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+! fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+***************
+*** 3862,3868 ****
+ fi
+ done
+ # Quote the link command for shipping.
+! relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+ # Only create the output if not a dry run.
+--- 4467,4473 ----
+ fi
+ done
+ # Quote the link command for shipping.
+! relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+ # Only create the output if not a dry run.
+***************
+*** 3879,3885 ****
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+--- 4484,4490 ----
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+***************
+*** 3893,3899 ****
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+--- 4498,4504 ----
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+***************
+*** 3904,3910 ****
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+--- 4509,4515 ----
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+***************
+*** 3952,3958 ****
+
+ # Directory that this library needs to be installed in:
+ libdir='$install_libdir'"
+! if test "$installed" = no && test $need_relink = yes; then
+ $echo >> $output "\
+ relink_command=\"$relink_command\""
+ fi
+--- 4557,4563 ----
+
+ # Directory that this library needs to be installed in:
+ libdir='$install_libdir'"
+! if test "$installed" = no && test "$need_relink" = yes; then
+ $echo >> $output "\
+ relink_command=\"$relink_command\""
+ fi
+***************
+*** 4088,4094 ****
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+! if test $# -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+--- 4693,4699 ----
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+! if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+***************
+*** 4128,4134 ****
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+--- 4733,4739 ----
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+***************
+*** 4145,4165 ****
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+- DESTDIR=
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+- case "$destdir" in
+- *"$libdir")
+- DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'`
+- if test "X$destdir" != "X$DESTDIR$libdir"; then
+- DESTDIR=
+- fi
+- ;;
+- esac
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+--- 4750,4761 ----
+***************
+*** 4173,4179 ****
+
+ if test -n "$relink_command"; then
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+- export DESTDIR
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+--- 4769,4774 ----
+***************
+*** 4181,4187 ****
+ continue
+ fi
+ fi
+- unset DESTDIR
+
+ # See the names of the shared library.
+ set dummy $library_names
+--- 4776,4781 ----
+***************
+*** 4201,4207 ****
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+! if test $# -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+--- 4795,4801 ----
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+! if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+***************
+*** 4287,4306 ****
+ destfile="$destdir/$destfile"
+ fi
+
+ # Do a test to see if this is really a libtool program.
+! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+ case $file in
+! */* | *\\*) . $file ;;
+! *) . ./$file ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+! $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+ exit 1
+ fi
+
+--- 4881,4921 ----
+ destfile="$destdir/$destfile"
+ fi
+
++ # If the file is missing, and there is a .exe on the end, strip it
++ # because it is most likely a libtool script we actually want to
++ # install
++ stripped_ext=""
++ case $file in
++ *.exe)
++ if test ! -f "$file"; then
++ file=`echo $file|${SED} 's,.exe$,,'`
++ stripped_ext=".exe"
++ fi
++ ;;
++ esac
++
+ # Do a test to see if this is really a libtool program.
+! case $host in
+! *cygwin*|*mingw*)
+! wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
+! ;;
+! *)
+! wrapper=$file
+! ;;
+! esac
+! if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+ case $file in
+! */* | *\\*) . $wrapper ;;
+! *) . ./$wrapper ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+! $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+***************
+*** 4340,4346 ****
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+! file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+--- 4955,4961 ----
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+! file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+***************
+*** 4358,4371 ****
+ fi
+ else
+ # Install the binary that we compiled earlier.
+! file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+! /usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+--- 4973,4986 ----
+ fi
+ else
+ # Install the binary that we compiled earlier.
+! file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyways
+ case $install_prog,$host in
+! */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+***************
+*** 4374,4380 ****
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+! destfile=`echo $destfile | sed -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+--- 4989,4995 ----
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+! destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+***************
+*** 4459,4465 ****
+ fi
+
+ # Exit here if they wanted silent mode.
+! test "$show" = ":" && exit 0
+
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+--- 5074,5080 ----
+ fi
+
+ # Exit here if they wanted silent mode.
+! test "$show" = : && exit 0
+
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+***************
+*** 4522,4528 ****
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+--- 5137,5143 ----
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+***************
+*** 4593,4599 ****
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+--- 5208,5214 ----
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+! if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+***************
+*** 4625,4631 ****
+ fi
+
+ # Now prepare to actually exec the command.
+! exec_cmd='"$cmd"$args'
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+--- 5240,5246 ----
+ fi
+
+ # Now prepare to actually exec the command.
+! exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+***************
+*** 4675,4684 ****
+ objdir="$dir/$objdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+! test $mode = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+! if test $mode = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+--- 5290,5299 ----
+ objdir="$dir/$objdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+! test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+! if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+***************
+*** 4702,4708 ****
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+--- 5317,5323 ----
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+***************
+*** 4710,4718 ****
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+! test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+! if test $mode = uninstall; then
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+--- 5325,5333 ----
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+! test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+! if test "$mode" = uninstall; then
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+***************
+*** 4721,4727 ****
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+! if test $? != 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+--- 5336,5342 ----
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+! if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+***************
+*** 4736,4742 ****
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+! if test $? != 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+--- 5351,5357 ----
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+! if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+***************
+*** 4748,4763 ****
+ ;;
+
+ *.lo)
+! if test "$build_old_libs" = yes; then
+! oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
+! rmfiles="$rmfiles $dir/$oldobj"
+ fi
+ ;;
+
+ *)
+ # Do a test to see if this is a libtool program.
+! if test $mode = clean &&
+! (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$file
+
+--- 5363,5392 ----
+ ;;
+
+ *.lo)
+! # Possibly a libtool object, so verify it.
+! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+!
+! # Read the .lo file
+! . $dir/$name
+!
+! # Add PIC object to the list of files to remove.
+! if test -n "$pic_object" \
+! && test "$pic_object" != none; then
+! rmfiles="$rmfiles $dir/$pic_object"
+! fi
+!
+! # Add non-PIC object to the list of files to remove.
+! if test -n "$non_pic_object" \
+! && test "$non_pic_object" != none; then
+! rmfiles="$rmfiles $dir/$non_pic_object"
+! fi
+ fi
+ ;;
+
+ *)
+ # Do a test to see if this is a libtool program.
+! if test "$mode" = clean &&
+! (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$file
+
+***************
+*** 4818,4823 ****
+--- 5447,5453 ----
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
++ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+ MODE must be one of the following:
+***************
+*** 4943,4948 ****
+--- 5573,5579 ----
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
++ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+***************
+*** 4993,4998 ****
+--- 5624,5649 ----
+
+ exit 0
+
++ # The TAGs below are defined such that we never get into a situation
++ # in which we disable both kinds of libraries. Given conflicting
++ # choices, we go for a static library, that is the most portable,
++ # since we can't tell whether shared libraries were disabled because
++ # the user asked for that or because the platform doesn't support
++ # them. This is particularly important on AIX, because we don't
++ # support having both static and shared libraries enabled at the same
++ # time on that platform, so we default to a shared-only configuration.
++ # If a disable-shared tag is given, we'll fallback to a static-only
++ # configuration. But we'll never go from static-only to shared-only.
++
++ # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
++ build_libtool_libs=no
++ build_old_libs=yes
++ # ### END LIBTOOL TAG CONFIG: disable-shared
++
++ # ### BEGIN LIBTOOL TAG CONFIG: disable-static
++ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
++ # ### END LIBTOOL TAG CONFIG: disable-static
++
+ # Local Variables:
+ # mode:shell-script
+ # sh-indentation:2
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index b7fa94d493c..c4285e7c632 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -46,16 +46,37 @@ if [ -d $BASE ] ; then
rm -r -f $BASE
fi
+BS=""
+EXTRA_BIN_FILES=""
+BASE_SYSTEM="any"
+MYSQL_SHARE=$BASE/share/mysql
+
+case $system in
+ *netware*)
+ BASE_SYSTEM="netware"
+ BS=".nlm"
+ MYSQL_SHARE=$BASE/share
+ EXTRA_BIN_FILES="netware/mysqld_safe.nlm netware/mysql_install_db.nlm \
+ netware/init_db.sql netware/test_db.sql netware/mysql_explain_log.nlm \
+ netware/mysqlhotcopy.nlm netware/libmysql.nlm"
+ ;;
+esac
+
+
mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \
- $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \
- $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \
- $BASE/mysql-test/t $BASE/mysql-test/r \
- $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/man $BASE/man/man1
-
+ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \
+ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \
+ $BASE/mysql-test/include $BASE/mysql-test/std_data
+
+if [ $BASE_SYSTEM != "netware" ] ; then
+ mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man $BASE/man/man1
+fi
+
chmod o-rwx $BASE/data $BASE/data/*
for i in ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \
- MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html
+ MySQLEULA.txt Docs/manual.html Docs/manual.txt Docs/manual_toc.html \
+ LICENSE.doc README.NW Docs/mysqlbug.txt
do
if [ -f $i ]
then
@@ -63,18 +84,23 @@ do
fi
done
-for i in extra/comp_err extra/replace extra/perror extra/resolveip \
- extra/my_print_defaults extra/resolve_stack_dump \
- isam/isamchk isam/pack_isam myisam/myisamchk \
- myisam/myisampack sql/mysqld client/mysqlbinlog \
- client/mysql sql/mysqld client/mysqlshow client/mysqlcheck \
- client/mysqladmin client/mysqldump client/mysqlimport client/mysqltest \
- client/mysqlmanagerc client/mysqlmanager-pwgen tools/mysqlmanager \
- client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
- client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \
- client/.libs/mysqlcheck client/.libs/mysqlbinlog \
- client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \
- tools/.libs/mysqlmanager
+for i in extra/comp_err$BS extra/replace$BS extra/perror$BS \
+ extra/resolveip$BS extra/my_print_defaults$BS \
+ extra/resolve_stack_dump$BS \
+ isam/isamchk$BS isam/pack_isam$BS \
+ myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \
+ sql/mysqld$BS \
+ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \
+ client/mysqldump$BS client/mysqlimport$BS \
+ client/mysqltest$BS client/mysqlcheck$BS \
+ client/mysqlbinlog$BS client/mysqlmanagerc$BS \
+ client/mysqlmanager-pwgen$BS tools/mysqlmanager$BS \
+ client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
+ client/.libs/mysqldump client/.libs/mysqlimport \
+ client/.libs/mysqltest client/.libs/mysqlcheck \
+ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \
+ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \
+ $EXTRA_BIN_FILES
do
if [ -f $i ]
then
@@ -86,6 +112,7 @@ if [ x$STRIP = x1 ] ; then
strip $BASE/bin/*
fi
+# Copy not binary files
for i in sql/mysqld.sym.gz
do
if [ -f $i ]
@@ -94,7 +121,11 @@ do
fi
done
-for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a
+if [ $BASE_SYSTEM = "netware" ] ; then
+ $CP -r netware/scripts/* $BASE/scripts
+fi
+
+for i in libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* libmysqld/libmysqld.a netware/libmysql.imp
do
if [ -f $i ]
then
@@ -102,39 +133,72 @@ do
fi
done
+# convert the libs to .lib for NetWare
+if [ $BASE_SYSTEM = "netware" ] ; then
+ for i in $BASE/lib/*.a
+ do
+ libname=`basename $i .a`
+ $MV $i $BASE/lib/$libname.lib
+ done
+fi
+
$CP config.h include/* $BASE/include
-rm $BASE/include/Makefile*; rm $BASE/include/*.in
+rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
+if [ $BASE_SYSTEM != "netware" ] ; then
+ rm -f $BASE/include/config-netware.h
+fi
-$CP tests/*.res tests/*.tst tests/*.pl $BASE/tests
+if [ -d tests ] ; then
+ $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests
+fi
+if [ -d man ] ; then
+ $CP man/*.1 $BASE/man/man1
+fi
$CP support-files/* $BASE/support-files
-$CP man/*.1 $BASE/man/man1
-$CP -r sql/share/* $BASE/share/mysql
-rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD
+if [ $BASE_SYSTEM == "netware" ] ; then
+ rm -f $BASE/support-files/magic \
+ $BASE/support-files/mysql.server \
+ $BASE/support-files/mysql*.spec \
+ $BASE/support-files/mysql-log-rotate \
+ $BASE/support-files/binary-configure
+fi
+
+$CP -r sql/share/* $MYSQL_SHARE
+rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
+
+for i in mysql-test/mysql-test-run mysql-test/install_test_db \
+ mysql-test/README \
+ netware/mysql_test_run.nlm netware/install_test_db.ncf
+do
+ if [ -f $i ]
+ then
+ $CP $i $BASE/mysql-test
+ fi
+done
-$CP mysql-test/mysql-test-run mysql-test/install_test_db $BASE/mysql-test/
-$CP mysql-test/README $BASE/mysql-test/README
$CP mysql-test/include/*.inc $BASE/mysql-test/include
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.001 $BASE/mysql-test/std_data
-$CP mysql-test/t/*.test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t
-$CP mysql-test/r/*.result mysql-test/r/*.require $BASE/mysql-test/r
+$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.sh $BASE/mysql-test/t
+$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r
+
+if [ $BASE_SYSTEM != "netware" ] ; then
+ $CP scripts/* $BASE/bin
+ $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
+ $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
+ $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
+ mv $BASE/support-files/binary-configure $BASE/configure
+ chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
+ $CP -r sql-bench/* $BASE/sql-bench
+ rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
+fi
-$CP scripts/* $BASE/bin
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
-$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
-$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
-$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
-
# Make safe_mysqld a symlink to mysqld_safe for backwards portability
# To be removed in MySQL 4.1
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
-mv $BASE/support-files/binary-configure $BASE/configure
-chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
-$CP -r sql-bench/* $BASE/sql-bench
-rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
-
# Clean up if we did this from a bk tree
if [ -d $BASE/sql-bench/SCCS ] ; then
find $BASE/share -name SCCS -print | xargs rm -r -f
diff --git a/sql/ChangeLog b/sql/ChangeLog
deleted file mode 100644
index a75e9761766..00000000000
--- a/sql/ChangeLog
+++ /dev/null
@@ -1,3307 +0,0 @@
-2000-12-07 Jeremy Cole <jeremy@mysql.com>
-
-* Added UPDATE ... ORDER BY ...
-* Added DELETE ... ORDER BY ...
-
-2000-11-11 Jeremy Cole <jeremy@mysql.com>
-
-* Added ALTER TABLE ... ORDER BY ...
-
-2000-09-17 Michael Widenius <monty@mysql.com>
-
-* Added option QUICK to DELETE to tell MySQL not to balance the
- trees on delete.
-
-2000-09-15 Michael Widenius <monty@mysql.com>
-
-* Added a thd argument to log::write() to get more speed.
-
-2000-09-01 Michael Widenius <monty@mysql.com>
-
-* Avoid allocation of "localhost" string.
-* Changed that TIMESTAMP(X) is sometimes as string
-* Release of 3.23.23
-
-2000-08-21 Michael Widenius <monty@mysql.com>
-
-* Added RENAME TABLE.
-
-2000-08-20 Michael Widenius <monty@mysql.com>
-
-* Added memory as inline functions to THD to get them a bit faster
-* Don't count entries with NULL in COUNT(DISTINCT ..)
-
-2000-08-08 Michael Widenius <monty@mysql.com>
-
-* Changed ALTER TABLE and LOAD DATA INFILE to create non unique, small keys
- after all rows are inserted.
-* Fixed use of UDF function with const arguments in WHERE clause.
-
-2000-07-11 Michael Widenius <monty@mysql.com>
-
-* Extended safe_mysqld; Patch by Christian Hammers
-
-2000-07-04 Michael Widenius <monty@mysql.com>
-
-* Changed the update log to take the query length argument; This
- should make the update log \0 safe.
-
-2000-06-21 Michael Widenius <monty@mysql.com>
-
-* Added net_read_timeout and net_write_timeout as startup parameters to mysqld
-
-2000-06-19 Michael Widenius <monty@mysql.com>
-
-* Changed the copyright of MySQL to GPL and LGPL.
-* Added myisampack and pack_isam to the MySQL distribution.
-
-2000-06-01 Michael Widenius <monty@mysql.com>
-
-* Added "FLUSH TABLES WITH READ LOCK" command
-
-2000-05-31 Michael Widenius <monty@mysql.com>
-
-* Added table locks to Berkeley DB.
-
-2000-05-28 Michael Widenius <monty@mysql.com>
-
-* Allow ON and USING with INNER JOIN.
-
-2000-05-23 Sasha
-
-* Fix that USE INDEX with 'PRIMARY' keys works.
-
-2000-05-20 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added symbolic links support for Win32.
-
-2000-05-19 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Changed protocol to let client know if the server is in AUTOCOMMIT mode
- and if there is a pending transaction. If there is a pending transaction
- the client library will give an error before reconnecting to the server to
- let the client know that the server did a rollback.
- The protocol is still backward compatible with old clients
-* 'kill' now works on a thread that is locked on a 'write' to a dead client.
-
-2000-05-18 Michael Widenius <monty@tik.pp.sci.fi>
-
-* unlock tables before sending last packet of SELECT ... result to client.
-
-2000-05-16 Michael Widenius <monty@mysql.com>
-
-* split Item_bool_func2::compare function into individual functions to get more
- speed.
-* Small optimizations of do_select() to get more speed.
-
-2000-05-15 Michael Widenius <monty@mysql.com>
-
-* CHECK will update the statistics for the keys.
-* Fixed bug in REPAIR TABLE when the table was used by other threads.
-
-2000-05-11 Michael Widenius <monty@mysql.com>
-
-* put CREATE TEMPORARY TABLE commands in the update log.
-* UPDATE IGNORE will not abort if an update gives a DUPLICATE_KEY error.
-* Ensure that all fn_format() or unpack_filename() is called for all
- generated filenames.
-
-2000-05-05 Michael Widenius <monty@mysql.com>
-
-* Added timzone variable to SHOW VARIABLES.
-
-2000-05-04 Michael Widenius <monty@mysql.com>
-
-* Don't write INSERT DELAYED to update log if SQL_LOG_UPDATE=0
-
-2000-05-03 Michael Widenius <monty@mysql.com>
-
-* Fixed problem with REPLACE on HEAP tables.
-
-2000-04-26 Michael Widenius <monty@mysql.com>
-
-* Added 'Writing to net' and 'Reading from net' as 'status' to
- mysqladmin processlist.
-
-2000-04-23 Michael Widenius <monty@mysql.com>
-
-* Added CREATE DATABASE and DROP DATABASE to the update log
-* Fixed problem when doing a GROUP BY on an enum column with MANY
- value combinations.
-* Avoid sorting for some simple GROUP BY queries.
-
-2000-04-22 Michael Widenius <monty@mysql.com>
-
-* Fixed problems in update log when using LAST_INSERT_ID() to update
- an table with an auto_increment key.
-* New function: 'NULLIF(expr1,expr2)'
-
-2000-04-14 Michael Widenius <monty@tik.pp.sci.fi>
-
-* UPDATE and DELETE on UNIQUE keys, where the whole key is used in the WHERE
- part, are now faster than before.
-
-* Added optimisation to skip ORDER BY parts where the order by column
- is a constant expression in the WHERE part. ORDER BY will also
- be skipped if ORDER BY matches a key where the key parts that are
- missing in the ORDER BY is constants:
-
- In the following case the ORDER BY will be removed:
- SELECT * FROM foo WHERE column=constant ORDER BY column;
-
- In the following case the first key will be used to solve the ORDER BY:
- SELECT * FROM foo WHERE key_part1=const ORDER BY key_part2;
-
-2000-04-10 Michael Widenius <monty@mysql.com>
-
-* Changed mysql.server to wait until the pid file is deleted on stop
-* Clients will automaticly be set to the same character set as the
- server if one hasn't specified a character set with mysql_option()
- or in the my.cnf files.
-
-2000-04-09 Michael Widenius <monty@mysql.com>
-
-* Release of 3.23.14
-* Fixed bug where complex CONCAT() use returned the wrong result.
-
-2000-04-07 Michael Widenius <monty@mysql.com>
-
-* Added some optimization to LIMIT when the used KEY matches almost all
- rows in the table. (SELECT * from table where key_column > "a" LIMIT 1).
-* REPLACE now honors the LOW_PRIORITY_UPDATES flag.
-
-2000-04-05 Michael Widenius <monty@mysql.com>
-
-* Fixed that DROP TABLE is logged in the update log.
-* Fixed problem when searching on DECIMAL() key field
- where the column data contained pre-zeros.
-
-2000-04-02 Michael Widenius <monty@mysql.com>
-
-* Fix bug in myisamchk when the auto_increment isn't the first key.
-
-2000-03-30 "Thimble Smith" <tim@mysql.com>
-
-* Allow DATETIME in ISO8601 format: 2000-03-12T12:00:00
-
-2000-03-30 Michael Widenius <monty@mysql.com>
-
-* Added UMASK_DIR environment variable.
-* Fixed problem with seek and RAID tables.
-
-2000-03-29 Michael Widenius <monty@mysql.com>
-
-* slow_queries log wasn't flushed on FLUSH LOGS.
-
-2000-03-28 Michael Widenius <monty@mysql.com>
-
-* Fix that DELETE FROM table_name; works on RAID tables.
-* Fix that DROP DATABASE works correctly with RAID tables.
-
-2000-03-27 Michael Widenius <monty@mysql.com>
-
-* Added function CONNECTION_ID()
-
-2000-03-26 Michael Widenius <monty@mysql.com>
-
-* When using = on BLOB or VARCHAR BINARY keys where only a part of the column
- was indexed, the whole column of the result row wasn't compared.
-
-2000-03-24 takeshi@SoftAgency.co.jp
-
-* Fix for sjis & order by
-
-2000-03-23 Michael Widenius <monty@mysql.com>
-
-* Added patches to allow client library to compile on BEOS.
-
-2000-03-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added STDCALL to some functions in libmysql that missed this.
-* When running in ANSI mode, don't allow one to use columns that isn't in
- the GROUP BY part.
-
-2000-03-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.13
-* Removed end space from double/float numbers in results from temporary
- tables.
-
-2000-03-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed automatic removal of table locks if doing a DROP TABLE on the last
- locked table.
-
-2000-03-13 Sasha
-
-* Added CHECK TABLE command.
-
-2000-03-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed int2str and longlong2str to use the optimized
- int10_to_str / longlong10_to_str functions.
-
-2000-03-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug so that mysqladmin shutdown will wait for the local server to close
- down.
-* Fixed a possible endless loop when calculating timestamp.
-
-2000-02-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.12
-* Changed that mysql_ping() doesn't increment the 'questions' status variable.
-* Fixed that mysql -D database doesn't kill 'mysql'.
-
-2000-02-24 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Only allow SHOW GRANTS if you have a privilege on the mysql
- tables
-* Fixed bug when storing 0 into a timestamp.
-
-2000-02-23 Michael Widenius <monty@monty.pp.sci.fi>
-
-* When doing mysqladmin shutdown on a local connection, mysqladmin now
- waits until the pidfile is gone before doing an shutdown.
-* Changed that the pid file is not removed until all threads have died.
-
-2000-02-23 Matt Wagner
-
-* When doing mysqladmin shutdown on a local connection, mysqladmin now
- waits until the pidfile is gone before doing an shutdown.
-
-2000-02-23 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with LEFT JOIN and key_field IS NULL.
-
-2000-02-23 Sasha
-
-* Fixed core dump with some COUNT(DISTINCT ...) queries.
-
-2000-02-21 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added options USE KEYS (key_list) and IGNORE KEYS (key_list) as
- join parameters in SELECT.
-* DROP of table is now done through the handler.
-
-2000-02-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added ANSI SQL syntax ALTER TABLE ADD (column_def1, column_def2 ...)
-
-2000-02-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with optimizer that could sometimes use wrong keys
-
-2000-02-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed that GRANT/REVOKE ALL PRIVILEGES doesn't affect GRANT OPTION
-* Removed extra ) from the output of SHOW GRANTS
-
-2000-02-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when storing numbers in timestamps.
-* Fix problem with timezones that has half hour offsets.
-* Storage of numbers in timestamp columns are now faster.
-
-2000-02-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow the syntax UNIQUE INDEX in CREATE statements.
-
-2000-02-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added options --i-am-a-dummy and --safe-updates to mysql.cc
-* Added variables select_limit and max_join_size to mysql.cc
-* Added sql variables: SQL_MAX_JOIN_SIZE and SQL_SAFE_UPDATES
-* Added READ_LOCAL lock that doesn't lock the table for concurrent inserts
-* Changed that LOCK TABLES .. READ doesn't anymore allow concurrent inserts
-* Added option --skip-delay-key-write to mysqld.
-
-2000-02-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed security problem in the protocol regarding password checking.
-
-2000-02-03 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Allow 'end' as a field name.
-* Added _rowid as an alias for an auto_increment column.
-
-2000-01-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Ignore empty queries in mysql when running in batch mode
- (To be able to handle rows with double ';' chars).
-
-2000-01-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with timestamps and INSERT DELAYED
-
-2000-01-26 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Fixed problem that affected queries that did arithmetic on GROUP functions.
-
-2000-01-24 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Don't give a unnecessary GRANT error when using tables from many
- databases in the same query.
-
-2000-01-20 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Fixed that 'date_column BETWEEN const_date AND const_date' works.
-
-2000-01-19 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when only changing a 0 to NULL in a table with BLOB/TEXT
- columns.
-* Fixed bug in range optimizer when using many key parts and or on the middle
- key parts: WHERE K1=1 and K3=2 and (K2=2 and K4=4 or K2=3 and K4=5)
-* Added the virtual VIO interface to the mysql connection streams.
- (This will make it possible to use SSL through the VIO classe interface)
-
-2000-01-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added command 'source' to mysql to allow reading of batch files inside
- mysql. Original patch by Matthew Vanecek.
-
-2000-01-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug that a change of all VARCHAR columns to CHAR columns didn't change
- row type from dynamic to fixed.
-
-2000-01-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added print of default arguments options to all clients.
-* Added --log-slow-queries to mysqld to log all queries that takes a
- long time to a separate log file with a time of how long the query took.
-* Fixed critical problem with the WITH GRANT OPTION option.
-* Added read-next-on-key to HEAP tables. This should fix all
- problems with HEAP tables when using not UNIQUE keys.
-* Disabled floating point exceptions for FreeBSD to fix core dump when
- doing SELECT floor(pow(2,63));
-
-2000-01-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed core dump when doing WHERE key_column=RAND(...)
- (Note that this query can never use keys as the RAND() function must be
- re-evaluated for each row)
-2000-01-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed optimization bug in SELECT .. LEFT JOIN ... key_column IS NULL, when
- key_column could contain NULL values.
-* Fixed problem with 8 bit characters as separators in LOAD DATA INFILE.
-
-2000-01-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.8
-
-1999-12-31 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed GRANT problem when doing 'CREATE TABLE ... SELECT'
-
-1999-12-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with timezones that are < GMT -11
-* Fixed problem with ISAM when doing some ORDER BY .. DESC queries.
-
-1999-12-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug when doing a join on a text key which didn't covert the whole key.
-* Option --delay-key-write didn't enable delayed key writing
-* Fixed update of TEXT column which only involved case changes.
-
-1999-12-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed that INSERT DELAYED doesn't update timestamps that are given.
-
-1999-12-25 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added function yearweek() and options 'x', 'X', 'v' and 'V' to date_format()
-
-1999-12-22 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Fixed problem with MAX(indexed_column) and HEAP tables.
-* Fixed problem with BLOB NULL keys and LIKE "prefix%".
-
-1999-12-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with MyISAM and fixed length rows < 5 bytes.
-
-1999-12-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added RAID support (patch from Tõnu Samuel)
-
-1999-12-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added -O interactive_timeout to mysqld.
-* Changed the argument of mysql_data_seek to ulonglong from ulong.
-
-1999-11-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-Fixed bug in replace() on Alpha. Patch by 'Tom Holroyd'
-Fixed bug in LOAD DATA LOCAL INFILE on Alpha. Patch by 'Tom Holroyd'
-
-1999-11-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added detection of pthread_attr_stacksize() in configure.
-* Added variable net_retry_count (needed for FreeBSD).
-
-Sun Nov 28 20:55:45 1999 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added option '--verbose' to mysqladmin
-
-1999-11-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when converting heap to myisam.
-* Fixed bug in HEAP tables when doing insert + delete + insert + scan the
- table.
-
-1999-11-23 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix core dump when releasing a lock from a non existing table
-* Remove locks on tables before starting to remove duplicates.
-* Added patch to make most string functions multi-byte safe (by Wei He)
-* Added Bytes_recieived/Bytes_sent statistics (by Sasha Pachev)
-* Added optimization of read_next() with MyISAM
-* Changed MyISAM to use concurrent inserts.
-
-1999-11-21 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Inverted flag 'delayed_key_write' on 'show variables'
-
-1999-11-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added variable max_write_lock_count
-
-1999-11-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.6
-* Made floor() overflow safe on FREEBSD.
-* Allow quoting of identifers with `
-* Temporary tables now start with #sql
-* Added option --quote-names to mysqldump.
-* Added option --ansi to change " to a identifier delimiter and || to
- string concatenation.
-* Fixed INTO DUMPFILE to give better error messages. NULL is now written
- as an empty string.
-* Changed Field_double and double->string to use snprintf() to avoid overflows.
-* Fixed bug that one could make a part of a PRIMARY KEY not null.
-* Fixed encrypt() to be thread safe and not reuse buffer.
-
-1999-11-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed that FLOAT(X) where X <= 24 -> FLOAT and X <= 53 -> DOUBLE.
-* Changed DECIMAL(X) to be DECIMAL(X,0) and DECIMAL to be DECIMAL(10,0)
-
-1999-11-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added mysqld option -O lower_case_table_names=[0|1] to force table
- names to lower case.
-* Added mysql_odbc_escape_string() function to support big5 characters in
- MyOBC.
-
-1999-11-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added patch by Sasha for user defined variables.
-* Changed that FLOAT and DOUBLE (without any length modifiers) are
- not anymore fixed decimal point numbers.
-
-1999-10-22 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added option ROW_FORMAT=[default, dynamic, static, compressed] to
- CREATE_TABLE
-
-1999-10-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* 'DELETE FROM table_name' didn't work on temporary tables
-
-1999-10-18 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.23.5
-* Fixed problem with LIKE "%const"
-
-1999-10-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added bit function ~ (neg)
-
-1999-10-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added support for the GBK Chinese character set (by Wei He)
-
-1999-10-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Storage of date results is now much faster to date and datetime columns.
-
-1999-10-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug when using DISTINCT + ORDER BY RAND()
-* new option --relative to mysqladmin.
-
-1999-10-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added some error messages in mysqld.cc
-* Allow use of NATIONAL and NCHAR when defining character columns.
- (They don't do anything)
-* Don't allow NULL columns in PRIMARY KEY:s (only in UNIQUE keys)
-
-1999-10-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Clear LAST_INSERT_ID if in uses this in ODBC context:
- WHERE auto_increment_column IS NULL;
-* 'SET SQL_AUTO_IS_NULL=0|1' now turns off/on the above handling of
- auto_increment columns
-
-1999-10-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added parameter 'concurrency' for Solaris.
-
-1999-10-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when using an auto_increment column in two keys
-
-1999-10-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* AS on fieldname with CREATE TABLE table_name SELECT ... didn't work.
-
-1999-10-01 Michael Widenius <monty@tik.pp.sci.fi>
-
-* LIKE with many % ("%xxx%yy%zz%") are now much faster.
-
-1999-09-24 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix privilege check for LOAD DATA REPLACE .
-
-1999-09-22 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added SHOW GRANT FOR user (by Sinisa)
-* Added date + INTERVALL # date_interval_type
-
-1999-09-19 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with index optimzation with 'WHERE index is not null'
-
-* Allow creation of temporary tables with same name as original table.
-* When granting user a grant option for a database, he couldn't grant
- privileges to other users.
-
-1999-09-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Inserting a DATETIME into a TIME column will not anymore try to store 'days'
- in it.
-* Fixed problem with storage of float/double on low endian machines.
-
-1999-09-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.3
-* Added limit to UPDATE
-* Added client library function: mysql_change_user()
-
-1999-09-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added character set to 'show variables'
-* Added support of '--[white-space]' as comment
-* Allow 'INSERT into table_name VALUES ();'
-
-1999-09-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Add mysqld option --delay-key-write to mysqld.cc
-
-1999-08-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with COUNT(DISTINCT) and GROUP BY
-
-1999-08-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added /*!version */
-* Fixed core dump with empty blob to reverse()
-* Fixed problem with year(now()) and year(curdate()).
-
-1999-08-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added construct:
-
- CASE value WHEN [compare-value] THEN result
- [WHEN [compare-value] THEN result ...]
- [ELSE result]
- END
-
- CASE WHEN [condition] THEN result
- [WHEN [condition] THEN result ...]
- [ELSE result]
- END
-1999-08-19 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added check of arguments to acos() and asin().
-* unique_column IS NULL only returned the first row with NULL.
-
-1999-08-12 Michael Widenius <monty@tik.pp.sci.fi>
-
-* REGEXP(...,NULL) will not return an error anymore.
-
-* Removed ifdef mSQL_COMPLIANT when comparing NULL to NULL
-
-1999-08-05 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix problem with LOCK TABLES and DELETE FROM table.
-
-1999-08-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Don't pack all keys even if one key is packed when not using PACK_KEYS=1.
-
-1999-08-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed core-dump bug when inserting table or column grant on user name ""
-
-1999-08-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix problem with LOCK TABLES when no database is selected.
-* New functions: MD5(), (by Tõnu Samuel) and EXPORT_SET (by Sasha Pachev)
-* Changed Socket to my_socket (to avoid conflicts)
-
-1999-07-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with DISTINCT on BLOB column
-* new keywords: CASE, THEN, WHEN, ELSE, END
-* The CASE operator (by Tõnu Samuel) (not yet working)
-* set SQL_LOW_PRIORITY_UPDATES=# didn't work
-* Fixed range optimizer bug in
- SELECT * FROM table_name WHERE key_part1 >= const AND (key_part2 = const OR key_part2 = const)
-
-1999-07-26 Michael Widenius <monty@tik.pp.sci.fi>
-
-* One can now update indexes columns that are used in the WHERE clause.
- UPDATE tbl_name SET KEY=KEY+1 WHERE KEY > 100;
-
-1999-07-25 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added get_date() function to all item and fields. This makes date handling
- a lot faster!
-* Added handling of fuzzy dates (dates where day or month is 0)
-
-1999-07-21 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Fixed optimization of SELECT ... WHERE key_part1=const1 and key_part_2=const2 and key_part1=const4 and key_part2=const4
- (indextype should be range instead of ref)
-
-1999-07-20 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Changed handling of 'const_item' to allow handling of
- ORDER BY RAND().
-* MyISAM tables now allows keys on NULL and BLOB columns.
-* Optimize the following LEFT JOIN:
- SELECT ... FROM t1 LEFT JOIN t2 ON ... WHERE t2.not_null_column IS NULL
-
-1999-07-19 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added ORDER BY and GROUP BY with functions
-* Changed all handling of tables in sql_select.cc to use table_map instead
- of table_nr.
-* Added use of column_name = formula to use keys
-* column_name = column_name2 don't anymore have to have identical packing
-* field IS NULL can now use keys
-
-1999-07-16 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Changed heap tables to be stored in low_byte_first order (to make it easy
- to convert to MyISAM tables)
-* Automatic change of HEAP temporary tables to MYISAM tables in case of
- 'table is full' errors.
-* Added option --init-file=file_name to mysqld
-
-1999-07-15 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added COUNT(DISTINCT value,[value,...])
-
-1999-07-14 Michael Widenius <monty@tik.pp.sci.fi>
-
-* changed name of temporary table to include getpid().
-* Added full support for CREATE TEMPORARY
-
-1999-07-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added CREATE TABLE options 'CHECKSUM' and 'PACK_KEYS'
-* Added mysqld option --default-table-type
-* Added column 'packed' to 'show index'
-* Added pack_keys and checksum to show table status
-
-1999-07-01 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.23.0
-* Show NULL as the default value for AUTO_INCREMENT columns.
-* Fixed optimizer bug with tables with only one row.
-* Fixed bug when using LOCK TABLES table_name READ; FLUSH TABLES;
-
-1999-06-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added use of LIBWRAP (by "Henning P . Schmiedehausen" <hps@tanstaafl.de>)
-
-1999-06-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Don't allow AUTO_INCREMENT for other than numerical columns
-* Using AUTO_INCREMENT will now automaticly make the column NOT NULL.
-
-1999-06-22 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added privilege column to 'show columns'
-
-1999-07-13 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added SQL_BIG_RESULT (SQL_SMALL_RESULT is now default)
-* Use the MYISAM UNIQUE constraint to solve SELECT DISTINCT faster.
-
-1999-06-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed most macros in the libmysql library to functions to avoid many
- versions of shared libraries.
-
-1999-05-16 Michael Widenius <monty@tik.pp.sci.fi>
-
-* Added "Row_type" to SHOW TABLE STATUS.
-
-1999-05-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added option IF NOT EXISTS to CREATE TABLE
-* Allow creation of CHAR(0) columns.
-
-1999-05-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added more error checking of errors from the table handler.
-
-1999-05-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added the '<=>' operator which will act as '=' but will return TRUE if both
- arguments are NULL.
-
-1999-05-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* The default base for the log, update-log and pid-file name is now
- 'hostname' with everything after the first '.' removed.
-
-1999-05-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Require '%' before format characters in DATE_FORMAT().
-* Add logging of GRANT and SET PASSWORD in the update log.
-
-1999-05-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed LIKE compare to behave as =; This means that 'e' LIKE 'é' is now
- true.
-
-1999-05-10 Michael Widenius <monty@tik.pp.sci.fi>
-
-* REPLACE now used direct read to find dupplicate row instead of key read;
- This makes REPLACE a lot faster.
-
-1999-05-05 Michael Widenius <monty@tik.pp.sci.fi>
-
-* New option: CREATE TABLE SELECT ....
-* Added syntax for CREATE TEMPORARY TABLE (not yet implemented)
-
-1999-05-03 Michael Widenius <monty@tik.pp.sci.fi>
-
-@code{DESCRIBE TABLE} returns a lot of information about the tables
-
-1999-05-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added comments to tables
-* Added UNIQUE, in CREATE TABLE table_name (col int not null UNIQUE);
-
-1999-04-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Use auto_increment value provided by MYISAM
-* Use key_part statistics if available
-
-1999-04-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* null bits are now stored at start of row instead at the end.
- (Now we only need one bit to mark a row deleted)
-
-* DELAYED is now a reserved words. (because of conflicts from yacc)
-
-1999-04-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added patches for DEC_3_2 by "Andrea Suatoni" <and@itaca.it>
-
-1999-04-19 Jani Tolonen <jani@monty.pp.sci.fi>
-
-* Added load_file() function
-
-1999-04-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added option --skip-show-databases to mysqld.
-
-1999-04-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* set start time when connection.
-
-1999-04-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with 'DELETE FROM TABLE' when table was locked by another
- thread.
-
-1999-04-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Check if rows has changed now also works with BLOB/TEXT.
-* Added the INNER JOIN syntax; This made 'INNER' a reserved word.
-
-1999-04-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with 'Host '..' is not allowed to connect to this MySQL
- server' after one had inserted a new MySQL user with a GRANT command.
-
-1999-04-01 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added support for netmasks to the hostname in the MySQL tables.
-
-1999-03-31 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed net.cc to use TCP_NODELAY also on Linux.
-* If one compares a NOT NULL DATE/DATETIME column with IS NULL, this
- is changed to a compare against 0 to satisfy some ODBC applications.
- (By shreeve@uci.edu)
-
-1999-03-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* NULL IN (...) now returns NULL instead of 0.
- This will ensure that 'null_column NOT IN (...)' doesn't match NULL values.
-* Changed the mysql.db entry to char(60).
-
-1999-03-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix storage of floating point values in TIME columns
-* Changed parsing of TIME strings to be more strict. Now the fractional
- second part is detected (and currently skipped)
- The following formats are supported
- [[[DAYS] [H]H:]MM:]SS[.fraction] and [[[[H]H]H]H]MM]SS[.fraction]
-* Detect (and ignore) second fraction part from DATETIME
-
-1999-03-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* On Win32 detect --basedir automaticly from path to mysqld.
-* Added option --skip-column-names to mysql.
-* Added some memory checks in sql_string.cc
-
-1999-03-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added the ODBC 3.0 EXTRACT(interval FROM datetime) function
-* Added lots of 'out of memory' checks for SELECT statements.
-
-1999-03-05 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed std() for big tables when result should be 0.
-
-1999-03-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* INSERT DELAYED had some garbage at end in the update log.
-
-1999-03-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added a lot of casts in filesort.cc to make it more portable.
-
-1999-02-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed default size of key_buffer to 4M
-* Fixed problem with queries that needed temporary tables with blobs.
-
-1999-02-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added LOAD DATA [LOW_PRIORITY] INFILE.
-* Added option 'flush-time' to force MySQL-Win32 version to flush
- the tables once in a while.
-* On Linux all process didn't die on shutdown.
-
-1999-02-18 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed a core dump problem when using --log-update and connecting
- without a default database.
-* Added more error check if one get an error writing to the log files.
-
-1999-02-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed some configure errors
-* If one used @code{LEFT JOIN} on tables that had circular dependencies this
- caused mysqld to hang forever.
-
-1999-02-05 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.22.16
-* mysqladmin processlist could core dump mysqld if a new user logged in.
-* DELETE FROM table_name WHERE key_column=column_name didn't find any matching
- rows.
-* The default index name is now using the same case as the used column name.
-
-1999-02-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added the MODIFY attribute to ALTER TABLE (to be compatible with some other
- SQL databases)
-* Added LIKE to 'show status'
-
-1999-01-31 Michael Widenius <monty@monty.pp.sci.fi>
-
-* DATE_ADD(column,...) didn't work.
-* INSERT DELAYED could deadlock with status 'upgrading lock'
-
-1999-01-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Extended item_encrypt() to take longer salt strings than 2 characters.
- (for FreeBSD)
-
-1999-01-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.22.15
-* LIKE on binary strings didn't work if one used a multi-byte character set.
-* mysqladmin -w will now wait for the server to come up if it's killed.
-
-Tue Jan 26 00:06:10 1999 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Fixed problem with ORDER BY whith 'only index' optimzation when there
- where multiple key definitions for an used column.
-* GRANT with password didn't update in memory GRANT table before
- 'mysqladmin flush'
-
-1999-01-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Updating BLOB/TEXT through formulas didn't work for short (< 256 char)
- strings.
-* Changed option --extended_insert-insert to --extended-insert in mysqldump
-
-1999-01-19 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Lots of changes to support INSERT DELAYED.
-
-1999-01-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed unpacking of DATE and DATETIME; These are now about 5 times faster.
-
-1999-01-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* DATE_ADD with now() or curdate() reused the same string.
-* Added BENCHMARK(loop-count,expression) function to time expressions.
-
-1999-01-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* LEFT JOIN USING (col1,col2) gave an error if one used it with tables
- from 2 different databases.
-* LOAD DATA LOCAL INFILE didn't work in the unix version because of a missing
- file in the sql directory
-* Fixed problems with VARCHAR/BLOB on very short rows (< 4 bytes); One
- could get error 127 when deleting rows.
-
-1999-01-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Nicer error messages for table types.
-* Changed default number of connections to 100
-
-1999-01-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* When one did a GRANT on a new host mysqld could die on the first connect
- from this host.
-* Use as default bigger buffers when using 'load data infile'.
-
-1999-01-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* All blob pointers have now reserved 8 bytes in the .frm files; This makes
- the .frm files portable to 64 bit architectures.
-
-* DECIMAL(x,y) now works according to ANSI SQL.
-
-1998-12-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* If one used ORDER BY on column name that was the same name as an alias,
- the ORDER BY was done on the alias.
-
-1998-12-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added aggregate UDF functions. Thanks to
- Andreas F. Bobak <bobak@relog.ch> for this !
-
-1998-12-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed sql_crypt() a bit to make it a bit more secure; This will make old
- string stored with the old decrypt() function unreadable!
-
-1998-12-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow empty arguments to mysqld to make it easier to start it
- from shell scripts!
-
-1998-12-23 Michael Widenius <monty@monty.pp.sci.fi>
-
-* last_insert_id() is now updated for INSERT INTO ... SELECT
-* Setting a TIMESTAMP column to NULL didn't record the timestamp
- value in the update log.
-
-1998-12-21 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed lock handler bug when one did:
- INSERT INTO TABLE ... SELECT ... GROUP BY.
-* Added a patch for localtime_r() on Win32 that it will not crash anymore
- if your date is > 2039, but instead it will return a time of all zero.
-* UDF function names are not longer case sensitive.
-* Added escape of '^Z' to \Z as ^Z doesn't work with pipes on Win32
-* Changed optimizer to not use 'range search' in some cases.
-* Changed optimizer to use result form 'check_range' in optimization of
- searching of part keys.
-
-1998-12-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* SELECT COUNT(*) didn't work on LEFT JOIN queries with only had expressions
- in the ON part and there where no WHERE clause.
-* Added optional support for crypted frm files.
-
-1998-12-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Saving NOW(), CURDATE() or CURTIME() directly in a column didn't work.
-* SELECT COUNT(*) didn't work on LEFT JOIN queries with only had expressions
- in the ON part and no WHERE clause.
-
-1998-12-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed a bug in sql_list.h that made ALTER TABLE dump a core in some context.
-
-1998-12-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow use of negative real numbers without a decimal point.
-* day number is now adjusted to max days in month if the resulting month
- after DATE_ADD/DATE_SUB() doesn't have enough days.
-
-1998-12-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fix that GRANT compares columns case insensitive.
-* Add / to TMPDIR if needed.
-
-1998-12-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow GLOBAL as a table or database name.
-
-Thu Dec 3 10:29:11 1998 Michael Widenius <monty@tik>
-
-* Added option SQL_SMALL_RESULT to SELECT to force use of fast temporary
- tables when one knows that the result set will be small!
-
-1998-11-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* The hostname in user@hostname can now include '.' and '-' without quotes.
-
-1998-11-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when using DATE_ADD()/DATE_SUB() in a WHERE clause.
-* One can now set the password for a user with the
- GRANT ... user IDENTIFIED BY 'password' syntax.
-* Fixed bug in GRANT checking with SELECT on many tables.
-* Removed some 'no Database selected' errors.
-* Release of 3.22.11
-
-1998-11-21 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed USER() to return user@host
-* New command: FLUSH STATUS ; to reset most status variables.
-* New status variables: aborted_threads and aborted_connects.
-
-1998-11-20 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug in ORDER BY on FIELD()
-* New function make_set() (70% by Jani Tolonen)
-
-1998-11-18 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added functions encrypt() and decrypt(). Because of endspace stripping of
- CHAR() and VARCHAR() these should only be used with fixed size strings or
- with BLOB/TEXT columns.
-
-1998-11-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Silently remove DEFAULT values from AUTO_INCREMENT columns.
-* Added new variable to mysqld: connection_timeout
-
-1998-11-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Better error message when table doesn't exists.
-
-1998-11-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added option SET SQL_WARNINGS=1 to get a warning count also for simple
- inserts.
-* IS NULL on a AUTO_INCREMENT column in a LEFT JOIN didn't work.
-* MySQL now uses SIGTERM instead of SIGQUIT with shutdown to work better
- on FreeBSD.
-* Added option \G (print vertically) to mysql
-* SELECT HIGH_PRIORITY ... killed mysqld.
-
-1998-11-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added grant checking to 'show tables'
-* Large changes to get grants integrated with the current privilege system.
-
-1998-11-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* SELECT .. WHERE t1.id1=t2.id2 could fail if t1.id1 and t1.id2 was keys
- and of radically differently types.
-* Changed get_password to use getpass function. (Patch by Jaromir
- Dolecek <dolecek@ics.muni.cz>)
-
-1998-11-04 Michael Widenius <monty@analytik>
-
-* Release of 3.22.10
-* Changed +, - (sign and minus), *, /, % and ABS() to be BIGINT aware.
-* ALTER TABLE and UPDATE now writes out the values of any duplicated keys.
-
-1998-11-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* ADABASD like INSERT statement:
- INSERT INTO table_name SET column=value,column=value...
-* The client flag option 'CLIENT_IGNORE_SPACE' didn't work properly.
-* Fixed bug in ALTER TABLE that caused a core dump.
-* Added optimization of SELECT ... FROM table ORDER BY key_part1 LIMIT ...
- This query will now use indexes instead of sorting the table.
-
-Mon Nov 2 20:52:15 1998 Jani Tolonen <jani@bitch.pp.sci.fi>
-
-* Added more variables to SHOW STATUS and changed format of output
-* Added command extended-status to mysqladmin which will show the
- new status
-
-1998-10-30 Michael Widenius <monty@monty.pp.sci.fi>
-
-* columns of type date, date_time and 'set' are now stored a little
- more efficient if they are 0, NULL or ''.
-
-1998-10-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Most errors are now printed through sql_write_error() which will add
- date, time and thread id to the .err log.
-
-1998-10-25 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added option MYSQL_INIT_COMMAND to mysql_options() to make a query
- on connect or reconnect.
-* Added option MYSQL_READ_DEFAULT_FILE and MYSQL_READ_DEFAULT_GROUP to
- mysql_option() to read the following parameters from the my.cnf file:
- "port", "socket", "compress", "password", "pipe", "timeout", "user",
- "init-command", "host" and "database"
-
-* Added maybe_null to the UDF structure
-
-1998-10-22 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added IGNORE to INSERT with many rows.
-* Added SQL GRANT commands
-* Release of 3.22.9
-
-1998-10-18 Michael Widenius <monty@monty.pp.sci.fi>
-
-* One can new set the last_insert_id() value in an update with
- LAST_INSERT_ID(expr). This makes it possible to return a value for things
- like:
- UPDATE table SET COUNT=LAST_INSERT_ID(COUNT+1) WHERE primary_key_col=#
-* display key name used by 'range' in the 'key' column in 'show processlist'
-* new SQL command: FLUSH [ TABLES | HOSTS | LOGS | PRIVILEGES ] [, ...]
-* new SQL command: KILL thread_id
-
-Thu Oct 15 18:57:15 1998 Michael Widenius <monty@tik>
-
-* Reuse memory for identical set and enum fields.
-
-1998-10-14 Michael Widenius <monty@analytik>
-
-* Added open file information to mysqladmin debug
-* Fixed conversion problem when using ALTER TABLE from a INT to a short CHAR()
- column.
-* Added 'SELECT HIGH_PRIORITY'; This will get a lock for the SELECT even if
- there is a thread waiting another SELECT to get a WRITE LOCK.
- NOTE: This makes HIGH_PRIORITY a reserved word
-
-1998-10-12 Michael Widenius <monty@analytik>
-
-* Moved wild_compare to string class to be able to use LIKE on BLOB/TEXT columns with \0
-* Added ESCAPE option to LIKE
-
-1998-10-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Update for AIX: Added a cast to all bzero() calls and changed to use
- my_gethostbyname_r instead of gethostbyname_r.
-
-1998-10-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.22.8
-* Added an extra thread signal loop on shutdown to avoid some error messages
- from the client.
-* MySQL now uses the next available number as extension for the update
- log file.
-
-1998-09-25 Michael Widenius <monty@monty.pp.sci.fi>
-
-* MySQL clients on NT will now by default first try to connect with named pipes
- and after this with TCP/IP.
-
-1998-09-24 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problems with TIME columns and negative strings.
-* Added a new column 'state' to 'mysqladmin proc' that gives some
- information what the thread is doing.
-
-* DATE_ADD() and DATE_SUB() didn't work with group functions.
-
-1998-09-23 Michael Widenius <monty@monty.pp.sci.fi>
-
-* 'mysql' will now also try to reconnect on 'use database' commands.
-
-* Fix problem with ORDER BY and LEFT JOIN and const tables.
-
-1998-09-22 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem with ORDER BY if the first ORDER BY column was a key and
- the rest wasn't.
-
-1998-09-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of 3.22.7
-* OPTIMIZE TABLE table_name can now be used to reclaim disk space
- after many deletes. This uses currently ALTER TABLE to re-generate
- the table, but in the future it will use an integrated isamchk
- for more speed.
-
-1998-09-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added functions for perfect hashing of symbols. Moved some other things
- to the LEX structure for faster setup.
-* Changed libmysql.dll on Win32 to use TLS to get better multi-threading
-
-1998-09-15 Michael Widenius <monty@monty.pp.sci.fi>
-* Added --where to mysqldump (patch by Jim Faucette).
-* Fixed slow UPDATE/DELETE when using DATETIME or DATE keys.
-
-1998-09-14 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed some optimizations parameters to make better joins.
-* Anyone can now use 'mysqladmin proc' to check ones own
- threads. Only users with the 'Process_priv' privilege can get
- information about all threads.
-* Fixed very unlikely optimizer bug in the range optimizer
- (bug introduced in 3.22.6)
-* Added handling of formats YYMMDD, YYYYMMDD, YYMMDDHHMMSS to
- DATETIME/TIMESTAMP when using numbers. (Before these formats only worked
- with strings).
-
-1998-09-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added connect option CLIENT_IGNORE_SPACE to allow one to use
- space after the function name and before '(' (Powerbuilder requires this).
- This will make all function names reserved words.
-* comments that start with /*! are now interpreted as commands. This feature
- allows one to use MySQL extensions like:
- 'SELECT /*! STRAIGHT_JOIN */ * from table1,table1'
- in a portable manor.
-
-1998-09-04 Michael Widenius <monty@analytik>
-
-* Added SET OPTION INSERT_ID=# to force use of specific INSERT_ID. This is
- usable with new --log-long-format option.
-
-1998-08-31 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed problem when INSERTING into TIME fields.
-
-1998-08-29 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added key cache and handler statistic to 'mysqladmin debug'.
-* changed UPDATE and DELETE to not use 'index only' range detection.
- (Fixed slow update_key in the benchmarks)
-* Changed the insert benchmark because it was impossible to use it with
- postgreSQL (to slow).
-
-Thu Aug 27 15:38:23 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* mysqldump will automaticly use LOAD DATA LOCAL INFILE if one uses
- an TCP/IP connection.
-
-1998-08-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added support of local files with LOAD DATA LOCAL INFILE ..
-* Save history if one kills mysql with ^C. Save history in MYSQL_HISTFILE.
- Modfied patch by Tommy Larsen <tommy@mix.hive.no>
-
-1998-08-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed a possible problem with mysql_refresh().
-
-Tue Aug 18 14:07:53 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Give an error for queries that mix GROUP columns and fields when there
- is no GROUP BY specification.
-
-1998-08-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed sql_yacc.yy to allow field attributes in any order.
-
-1998-08-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Increased max_allowed_packed to 1M as default.
-* LOAD DATA INFILE didn't copy single field separators in some case:
- "Hello"Atif"!"
-
-1998-08-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed fatal bug in lpad().
-
-Thu Aug 13 01:00:44 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* REGEXP can now take a expression as the second argument.
-
-1998-08-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed LIKE to be faster in some cases with many '%': LIKE '%c%ompiler%'
-
-1998-08-11 Michael Widenius <monty@monty.pp.sci.fi>
-
-* All table lock handing is changed to avoid some very subtitle
- deadlocks when using DROP TABLE, ALTER TABLE, DELETE FROM TABLE and
- mysqladmin flush-tables under heavy usage.
-
-1998-08-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow one to use the syntax 'CONSTRAINT symbol' before FOREIGN KEY.
-* new mysqld option '--low-priority-insert' to give inserts lower priority
- than selects.
-* One can now use {INSERT | REPLACE} LOW_PRIORITY INTO ...
- One side effect is that LOW_PRIORITY is now a reserved word :(
-* Changed locking code to get better handling of locks of different types.
-
-1998-08-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* mysqld will now ignore trailing ';' characters in queries. This is to
- make it easier to emigrate from some other SQL servers that require the
- end ';'
-* One can now use a LIMIT value with DELETE to make it return after deleting
- a given number of rows.
-* Fix for corrupted output of fixed format and SELECT INTO OUTFILE:
- select * from test into outfile "/tmp/test.txt" fields terminated by '' enclosed by ''
-
-1998-08-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* new mysqld option: '-O max_connect_errors=#'.
- Connect errors are now reset for each correct connection.
-* Add support for INSERT INTO table ... VALUES(...),(...),(...)
-
-1998-08-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added Oracle GREATEST() and LEAST() functions. One must now use
- these instead if the MAX() and MIN() functions to get the biggest/smallest
- value from a list of values. These can now handle real, bigint and
- string values.
-* The following query now uses indexing instead of sorting the table:
- SELECT ... FROM table ORDER BY key_part1 desc,key_part2 desc,...
-* Added check that the error message file has enough error messages.
-* DAYOFWEEK() had offset 0 for Sunday. Changed the offset to 1.
-
-1998-08-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* new option to mysql: '--vertical' to print results in vertical mode.
-* All count structures in the client (affected_rows, insert_id...) are now of
- type BIGINT to allow one to use 64 bit values.
- This required a minor change in the MySQL protocol which may affect
- old clients when using tables with auto_increment values > 24M.
-* The return type of mysql_fetch_lengths() has changed from uint *
- to ulong *. This may give a warning for old clients but should work
- on most machines.
-
-Thu Jul 30 15:29:05 1998 Michael Widenius <monty@tik>
-
-* COUNT(), STD() and AVG() are extended to handle more than 4G rows.
-
-Wed Jul 29 10:36:05 1998 Michael Widenius <monty@tik>
-
-* Added new option:
- SET OPTION SQL_LOG_UPDATE=[0,1] to allow users with process_priv
- privilege to bypass the update log.
- (Modified patch from Sergey A Mukhin <violet@rosnet.net>)
-
-Thu Jul 23 15:58:13 1998 Michael Widenius <monty@tik>
-
-* Initialize line buffer in mysql.cc to make blob readings from pipes safer.
-
-Tue Jul 21 22:04:43 1998 Michael Widenius <monty@tik>
-
-* One can now store -838:59:59 <= x <= 838:59:59 in a TIME column.
-* TIME_TO_SEC() and SEC_TO_TIME() can now handle negative times and hours
- up to 32767.
-
-Mon Jul 20 20:34:33 1998 Michael Widenius <monty@tik>
-
-* Change mysys/dbug to allocate all thread varibles in one struct.
- This makes it easier to make a threaded libmysql.dll
-
-Sun Jul 19 12:54:45 1998 Michael Widenius <monty@tik>
-
-* Changed ALTER TABLE to make it more multi-thread safe.
-* normal INSERT INTO TABLE are now also cached when used with
- LOCK TABLES. (previously only INSERT ... SELECT and LOAD DATA INFILE
- was cached)
-
-Fri Jul 17 20:53:23 1998 Michael Widenius <monty@tik>
-
-* Allow group functions with HAVING:
- SELECT col FROM table GROUP BY col HAVING COUNT(*)>0;
-
-Tue Jul 14 15:11:52 1998 Michael Widenius <monty@tik>
-
-* Use the result from 'gethostname' as the name for pid files
- (instead of uname()).
-
-Sun Jul 12 12:38:45 1998 Michael Widenius <monty@tik>
-
-* Index only optimization; Some queries are now resolved using
- only indexes. Until MySQL 4.0 this works only for number columns.
-
- SELECT key_part1,key_part2 FROM table WHERE key_part1=#
- SELECT COUNT(*) FROM table WHERE key_part1=# and key_part2=#
- SELECT key_part2 FROM table GROUP BY key_part1;
- SELECT * FROM table ORDER BY key_part2;
-
-1998-07-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added function DATE_ADD() and DATE_SUB()
-
-1998-07-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added function SUBSTRING() with 2 arguments.
-
-1998-07-05 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added optimization to remove const reference tables from ORDER BY and
- GROUP BY.
-* Allow '$' in table and column names.
-
-1998-07-04 Michael Widenius <monty@monty.pp.sci.fi>
-
-* new option --tmpdir for mysqld.
-
-1998-07-03 Michael Widenius <monty@monty.pp.sci.fi>
-
-* MySQL now automaticly changes a query from an ODBC client:
- SELECT ... from table WHERE auto_increment_column IS NULL
- to
- SELECT ... from table WHERE auto_increment_column == LAST_INSERT_ID().
- This allows some ODBC programs (Delphi, Access) to retrieve the newly
- inserted row to fetch the auto_increment id.
-* Drop table now waits for all users to free a table before deleting it
-
-1998-07-02 Michael Widenius <monty@monty.pp.sci.fi>
-
-* New functions: BIN(), HEX() and CONV() for converting between different
- number bases.
-
-1998-07-01 Michael Widenius <monty@monty.pp.sci.fi>
-
-* If one created a table with smaller record length than 5, one couldn't
- delete rows from this table
-* mysqld now automaticly disables system locking on Linux, Win32 and if
- one uses MIT-threads. One can force the use of locking by doing:
- --enable-locking.
-* Added new mysqld option --console, to force a console window (for error
- messages) when using Win32.
-* Removed a useless check in the ISAM delete code; Delete should now be
- a bit faster.
-
-1998-06-28 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.22.3
-* New flag to mysqld: --one-thread for debugging with linuxthreads (or glibc)
-
-1998-06-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added the LEX structure to THD to get a bit more speed.
-* Added DROP TABLE IF EXISTS to not get an error if the table doesn't exists.
-* IF and EXISTS are now reserved words (they would have to be sooner or later)
-
-1998-06-26 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added lots of new options to mysqldump.
-
-Wed Jun 24 23:33:35 1998 Michael Widenius <monty@tik>
-
-* Server error messages are now in mysqld_errror.h
-* Added compression server/client protocol. (By Sinisa).
-
-1998-06-22 Michael Widenius <monty@monty.pp.sci.fi>
-
-* New functions: <<, >>, rpad() and lpad().
-* Fixed a core-dump bug in the range optimizer.
-
-Fri Jun 19 01:51:09 1998 Michael Widenius <monty@tik>
-
-* One can now save default options (like passwords) in a config file (my.cnf).
-
-1998-06-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* searching on multiple constant keys that matched > 30 % of the rows didn't
- always use the best possible key.
-
-1998-06-16 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Lot's of small changes to get ORDER BY to work when no records are found
- when using fields that are not in GROUP BY (MySQL extension)
-* Added new option --chroot to mysqld to start mysqld in a chroot environment
- (by Nikki Chumakov <nikkic@cityline.ru>)
-
-1998-06-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Add option --one-database to mysql to only update one database
- from a update log.
-
-1998-06-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* end space is now ignored when comparing case sensitive strings;
- This should fix some problems with ODBC!
-* mysql_free_result() now automaticly handles a mysql_use_result() set that
- is not completely read.
-
-1998-06-10 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.22.1
-* Fixed problems with date_format() and wrong dates.
-* enum() and set() columns was compared binary; Changed to be case insensitive.
-
-1998-06-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added new API functions: mysql_init() and mysql_options().
- One MUST now call mysql_init() before one calls mysql_real_connect().
- One doesn't have to call mysql_init if one only calls mysql_connect().
-* LEFT JOIN core dumped if the second table is used with a constant
- WHERE/ON expression with uniquely identifies one record.
-
-1998-06-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Range optimizer is not used anymore when comparing a string column
- to a number. This will make such compares slower but safer.
-
-Sun Jun 7 04:47:14 1998 Michael Widenius <monty@tik>
-
-* UPDATE now returns a update information about how many rows was
- matched, updated and if one got any 'warnings' when doing the update.
-
-Sat Jun 6 22:58:02 1998 Michael Widenius <monty@tik>
-
-* Fixed wrong result from 'format(-100,2)'.
-
-1998-06-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added new C-API function: mysql_ping().
-* Added options AFTER column and FIRST to ALTER TABLE ... ADD columns.
- This makes is possible to add a new column at some specific location
- in an old table.
-* Fixed problem with find_in_set().
-
-1998-05-18 Michael Widenius <monty@analytik>
-
-* Added new API function: mysql_ping().
-
-1998-05-15 Michael Widenius <monty@monty.pp.sci.fi>
-
-* WEEK() now takes an optional argument to allow handling of weeks when the
- first day of the week = Sunday (default or 0) or Monday ( extra argument is
- 1). WEEK() now returns the week number in the range 0-53 for the used
- year.
-
-1998-05-13 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added flag -T32 to mysqld for running all queries under the main thread.
- This makes it possible to debug mysqld under Linux with gdb!
- (This is now called --one-thread)
-
-1998-05-12 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added optimization of 'not_null_column IS NULL' (needed for some Access
- queries)
-* Made all time functions 'more streamlined'.
-
-1998-05-09 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow one to use STRAIGHT_JOIN between two tables to force the optimizer
- to join them in a specific order.
-
-Fri May 8 02:35:00 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added SET OPTION PASSWORD='new_crypted_password' and
- SET OPTION PASSWORD= 'host' : 'user' : 'new_password'. The last version
- only works for users with write access to the mysql database.
- One can also use: SET OPTION PASSWORD=PASSWORD("new_password");
-
-Tue May 5 14:41:47 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* String functions now return VARCHAR() instead of CHAR() and
- the column type is now VARCHAR() for fields saved as VARCHAR().
- This should make the MyODBC driver better, but may break some old
- MySQL clients that doesn't handle FIELD_TYPE_VARCHAR identical as
- FIELD_TYPE_CHAR.
-
-Mon May 4 00:33:27 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added BOOL as a synonym for BIT and DISTINCTROW as a synonym for DISTINCT.
-* CREATE INDEX and DROP INDEX are now implemented trough ALTER TABLE.
- CREATE TABLE is still the recommended (fast) way to create indexes.
-* Added option SET OPTION PASSWORD='new_password'.
- mysqladmin can now be used by not anonymous users to change their
- password.
-
-Sun May 3 18:47:24 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added option wait_timeout to mysqld.
-
-Sat Apr 18 14:14:23 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added hashing of fieldnames for tables with many fields.
-* The most frequently used string functions are now in assembler (Linux-intel).
-
-Thu Apr 16 16:14:14 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* Added quick checking if ok host.
-* Changed the interface for field->val_str() to better use stack buffers.
-
-Thu Apr 9 20:02:26 1998 Michael Widenius <monty@bitch.pp.sci.fi>
-
-* One can now reference to tables in different databases with:
- table@database or database.table
-* Added cacheing of users & access rights (for faster access rights checking)
-
-1998-04-08 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Save of command line history to file in mysql client.
- by Tommy Larsen <tommy@mix.hive.no>
-
-1998-04-07 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added time column to 'mysqladmin processes' to show how long a query
- has taken or how long a thread has sleeped.
-
-1998-04-06 Michael Widenius <monty@monty.pp.sci.fi>
-
-* 'show variables' now gives the correct path for 'datadir'.
-* Added logging and update_log to "show variables"
-
-1998-03-29 Michael Widenius <monty@analytik>
-
-* Added new type: YEAR. YEAR is stored on 1 byte with range 0, 1901-2155.
-* Added new DATE type that is stored on 3 bytes instead of 4. All new
- tables will created with the new date type if one doesn't use
- --old-protocol.
-* Fixed bug in record caches; One could get 'Error from table handler: #'
- on some OS from some queries.
-
-1998-03-27 Michael Widenius <monty@monty.pp.sci.fi>
-
-* mysql (the command line tool) striped start space from new rows.
-
-1998-03-25 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added user level locks: GET_LOCK(string,timeout), RELEASE_LOCK(string)
-* Fixed bug in range optimizer when using:
- WHERE key_part_1 >= something and key_part_2 <= something_else
-* Changed connect timeout to 3 seconds to make it somewhat harder
- for crackers to kill mysqld trough telnet + TCP/IP.
-
-1998-03-24 Michael Widenius <monty@monty.pp.sci.fi>
-
-* new mysqld option --big-selects:
- Allow big result sets by saving all temporary sets on file.
- (Solves most 'table full' errors)
-
-1998-03-21 Michael Widenius <monty@monty.pp.sci.fi>
-
-* WHERE with string-column-key = constant-string didn't always find all rows
- if the column had many values differing only with characters of the same sort
- value (like e and é).
-* Added opened_tables to 'show status'.
-* Strings keys looked up with 'ref' was not compared case sensitively.
-* Added flag '--big-selects' to avoid 'Table is full' errors.
- Using this will slow down some queries thought.
-* Added umask() to make log_files non-readable for normal users.
-* Fixed some odd cases with queries that uses group functions where
- the WHERE or HAVING didn't match anything.
-* Ignore users with old password (8 byte) on startup if not using
- --old-protocol.
-* Changed name of the sql_memory allocation system and moved this to
- the mysys library.
-
-1998-03-17 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added use of current_date, current_time and current_timestamp functions
- without (). This automaticly made these reservered words :(
-
-Tue Mar 10 12:34:50 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed mysql_real_connect() to include possible db for faster connection
- to a new db.
-* select which matched all key fields returned the values in the same
- case as the matched values instead of the found values.
-* Release of 3.21.26
-* In DATE_FORMAT() PM and AM was swapped for hours 00 and 12.
-
-Mon Mar 9 14:15:00 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added some tests to the table order optimizer to get some cases with
- 'SELECT ... FROM many_tables' much faster.
-* Added a retry loop around accept() to possible fix some problems on some
- Linux machines.
-
-Fri Mar 6 01:18:47 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* from_days(0) now returns "0000-00-00"
-* Enchanted mysql_connect protocol to allow one to specify database
- on connection. This will make MySQL twice as fast to connect to a database
- for new clients.
-
-Thu Mar 5 18:09:45 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Updated record_cache code to be aligned for more speed.
-* New tests to crash-me
-* Extended the default max key size to 256.
-
-Wed Mar 4 00:02:16 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug when using BLOB/TEXT in GROUP BY with many tables.
-
-Mon Mar 2 18:58:10 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* A enum field that is not declared NOT NULL has NULL as default value.
- (Before the default value was the first enum option)
-
-Tue Feb 24 20:11:30 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Fixed bug in the join optimizer code when using many part keys
- on the same key: INDEX (Organisation,Surname(35),Initials(35)).
-
-Mon Feb 23 16:15:39 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* One can now kill threads that are waiting for 'disk full'.
-* Fixed some problems with UDF functions.
-* ALTER TABLE + IGNORE now returns right number of affected rows.
-* Fixed a bug when using 8 bytes long (alpha); filesort() didn't work.
- Affects DISTINCT, ORDER BY and GROUP BY on 64 bit processors.
-
-Sat Feb 21 15:36:48 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed typedef string to my_string because of C++ new string class.
-* now one can kill threads that's are waiting on 'disk full'.
-
-Fri Feb 13 23:19:23 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.21.24
-* Fixed problem with LEFT JOIN and constant expressions in the ON part.
-
-Thu Feb 12 02:54:57 1998 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Added much more descriptive error messages to mysqladmin if connect failed.
-* Dynamic loadable functions. Based on source from:
- Alexis Mikhailov <root@medinf.chuvashia.su>
-
-Thu Feb 5 15:19:14 1998 <monty@monty.pp.sci.fi>
-
-* One couldn't delete from a table if no one had done a select on the table.
-* Fixed problem with range optimizer which many OR's on key parts inside
- each other.
-
-Tue Feb 3 14:34:32 1998 <monty@monty.pp.sci.fi>
-
-* Changed default umask for new files from 0664 to 0660.
-
-Fri Jan 30 23:58:19 1998 <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.21.23
-* Changed ALTER TABLE to work with WIN32 (Win32 can't rename open files)
-
-Thu Jan 29 20:37:50 1998 <monty@monty.pp.sci.fi>
-
-* Fixed that the following symbols are not reserved words:
- TIME DATE TIMESTAMP TEXT BIT ENUM NO ACTION CHECK YEAR MONTH DAY HOUR
- MINUTE SECOND STATUS VARIABLES.
-* Changed string handling in sql_yacc.yy and sql_lex.cc to be faster.
-* Setting a TIMSTAMP to NULL in LOAD DATA INFILE... didn't set the current
- time for the TIMESTAMP.
-* Fixed that key conversions are tested in the WHERE clause
-* LOAD DATA INFILE .... REPLACE INTO ... had wrong 'skipped' count
-
-Tue Jan 27 15:24:50 1998 <monty@monty.pp.sci.fi>
-
-* Added switch --skip-thread-prior for systems where mysqld's thread
- scheduling doesn't work properly. At least BSDI 3.1 works better with
- this!
-* Added ODBC functions DAYNAME() and MONTHNAME().
-* Fixed unlikely(?) key optimizer bug when using ORs inside ANDs.
-
-Sat Jan 24 03:35:46 1998 <monty@monty.pp.sci.fi>
-
-* Release of 3.21.22
-* Added support of 'long constant strings' from ANSI SQL:
- select 'first ' 'second'; -> 'first second';
-
-Mon Jan 19 17:59:49 1998 <monty@monty.pp.sci.fi>
-
-* Fixed problem with Russian character set and LIKE.
-* Fixed bug in ORDER BY on string formula with possible NULL values.
-* Added functions DAYOFYEAR(), DAYOFMONTH(), MONTH(), YEAR(), WEEK(),
- QUARTER(), HOUR(), MINUTE(), SECOND() and FIND_IN_SET().
-* Changed weighting, when using many key parts, in join optimizer to avoid
- full joins for a couple of cases.
-
-Sun Jan 18 21:16:06 1998 <monty@monty.pp.sci.fi>
-
-* Removed that NULL = NULL is true. Now one must use IS NULL or IS NOT NULL
- to test if a value is NULL. (This is according to ANSI SQL but may break
- old applications that are ported from mSQL)
- One can get the old behaviour by compiling with -DmSQL_COMPLIANT
-* Fix of count(*) problems when the WHERE clause didn't match any records.
-* Added function DAYOFMONTH()
-
-1998-01-14 Michael Widenius <monty@analytik>
-
-* Fixed mysqladmin.c to display only the used socket or TCP/IP port.
-
-Mon Jan 12 19:32:31 1998 <monty@monty.pp.sci.fi>
-
-* Changed SHOW FIELDS to return NULL as default value for TIMESTAMP
- (This removes the DEFAULT "" entry for timestamps in mysqldump)
-* Release of MySQL 3.21.21
-* Added commands SHOW STATUS and SHOW VARIABLES.
-* Fixed optimizer bug when using
- 'WHERE data_field=date_field2 and date_field2=constant'
-
-Sun Jan 11 05:07:59 1998 <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.21.20
-* Added long comments to MySQL /* */
-* Changed lex parsing to be a bit faster in some cases.
-
-Sat Jan 10 15:17:44 1998 <monty@monty.pp.sci.fi>
-
-* Fixed bug when using SELECT DISTINCT + NULL values.
-
-Fri Jan 9 16:45:26 1998 <monty@monty.pp.sci.fi>
-
-* Changed maximum table name and column name lengths from 32 to 64.
-* Aliases can now be of 'any' length.
-
-Thu Jan 8 02:28:11 1998 <monty@monty.pp.sci.fi>
-
-* Now one gets an error if one tries to create an INDEX or UNIQUE
- on a column that allows NULL values. (Before the column was silently
- made NOT NULL).
-
-Wed Jan 7 23:19:11 1998 <monty@monty.pp.sci.fi>
-
-* Changed protocol (downward compatible) to mark if a column
- is auto_increment or a timestamp. This is needed for the
- new java driver.
-* One can now in the clients check if a column is a automatic
- TIMESTAMP or a AUTO_INCREMENT field.
-
-Sun Jan 4 20:10:21 1998 <monty@monty.pp.sci.fi>
-
-* Added update of big5 by jou@pdlc.ieo.nctu.edu.tw
-* Added hebrew sorting order by Zeev Suraski.
-
-Thu Jan 1 12:57:04 1998 <monty@monty.pp.sci.fi>
-
-* Release of 3.21.19
-* unique key fields was not marked as unique keys in mysqlshow.
-* Added function REVERSE() (by Zeev Suraski)
-* Changed ni_range() to fixed a case of slow range searching.
-
-Wed Dec 31 15:46:25 1997 <monty@monty.pp.sci.fi>
-
-* Release of 3.21.18a
-* Fixed problem with new filesort code from 3.21.18 on Linux
-
-Mon Dec 29 10:02:24 1997 <monty@monty.pp.sci.fi>
-
-* Added CROSS JOIN syntax. CROSS is now a reserved word
-* USE database was not always written to output log.
-* mysqladmin command 'status' doesn't increment 'Questions' anymore.
-
-Sun Dec 28 13:20:20 1997 <monty@monty.pp.sci.fi>
-
-* Recoded yacc/bison stack allocation to be even safer and allow MysQL
- to handle even bigger expressions.
-
-Sat Dec 27 15:28:39 1997 <monty@monty.pp.sci.fi>
-
-* last_insert_id and used timestamp is now written to update log file.
- timestamps, calculations with time and LAST_INSERT_ID() will now work
- correctly when updating from the update log.
-
-Fri Dec 26 17:03:14 1997 <monty@monty.pp.sci.fi>
-
-* Give error message if client C functions are called in wrong order.
-* Added automatic reconnect of clients for some cases.
-
-Mon Dec 22 00:25:34 1997 <monty@monty.pp.sci.fi>
-
-* Range optimizer didn't solve ranges of type:
- key_part1= x AND key_part2 > y. This forced some ORDER BY queries to
- do a full table scan when used with where like above.
-* Small sort sets doesn't use temporary files anymore.
-
-Fri Dec 19 16:30:24 1997 <monty@monty.pp.sci.fi>
-
-* Release of MySQL 3.21.17a
-* Fixed problem with compare of binary strings and blobs with ASCII
- characters over 127.
-
-Thu Dec 18 00:33:25 1997 <monty@monty.pp.sci.fi>
-
-* Fixed core dump in first() when chaning some very specific AND and OR
- key columns.
-* Fixed lock problem: When freeing a read lock on a table with multiple
- read locks, a thread waiting for write lock would have given the lock.
- This shouldn't affect data integrity, but could possible make mysqld
- to restart if one thread was reading data that another thread modified.
-* LIMIT offset,count didn't work in INSERT ... SELECT.
-
-Wed Dec 17 12:35:11 1997 <monty@monty.pp.sci.fi>
-
-* optimized key block caching. This will be quicker than the old one when
- using bigger key caches.
-
-Tue Dec 16 23:33:24 1997 <monty@monty.pp.sci.fi>
-
-* Changed bool to my_bool in some item structures to use less memory.
-* Changed optimizer to use array references. This made the code 'nicer'
-
-Mon Dec 15 17:03:43 1997 <monty@monty.pp.sci.fi>
-
-* Release of Mysql 3.21.17
-* mysql: Added ouput of line number on errors when running batch.
-* SELECT column,SUM(expr) now returns NULL for column when there is no
- matching rows.
-
-Sun Dec 14 14:59:46 1997 <monty@monty.pp.sci.fi>
-
-* Fixed create problem with fixed length records of exactly 256 bytes.
- (One couldn't insert more than 1 record in such a table).
-
-Fri Dec 12 18:31:32 1997 <monty@monty.pp.sci.fi>
-
-* Added ODBC and ANSI SQL style LEFT OUTER JOIN.
- The following are new reserved words: LEFT, NATURAL, USING
-* Changed use of table bits and key bits to use typedefs to make it easy
- to extend join tables and keys to 64.
-* The client library is now using the environment variable MYSQL_HOST as
- the default host if it's defined.
-
-Wed Dec 10 01:29:11 1997 <monty@monty.pp.sci.fi>
-
-* Release of 3.21.16a
-* Field type SET with 33-55 elements didn't work.
-* Release of 3.21.16
-* Fixed bug in ALTER TABLE when copying from DATETIME to TIMESTAMP.
- (All TIMESTAMP where set to current time).
-
-Tue Dec 9 14:53:15 1997 <monty@monty.pp.sci.fi>
-
-* Added function TIME_TO_SEC()
-
-Mon Dec 8 09:56:44 1997 <monty@monty.pp.sci.fi>
-
-* Allow empty strings as default values for BLOB and TEXT to be compatible with
- mysqldump.
-* Added ODBC 2.0 & 3.0 functions: POWER(), SPACE(), COT(), DEGREES(), RADIANS(),
- ROUND(2 arg) and TRUNCATE().
-* Added optional (ignored) argument to CURRENT_TIME() and CURRENT_TIMESTAMP().
-* LOCATE() parameters where swapped according to ODBC standard. Fixed.
-* Added detection of all ODBC 3.0 functions to crash-me
-* In some cases default values was not used for NOT NULL fields.
-* Timestamp wasn't updated in UPDATE SET... if the timestamp was used as
- a value or in the WHERE clause.
-
-Sun Nov 30 04:06:31 1997 <monty@monty.pp.sci.fi>
-
-* Renamed version.h to mysql_version.h
-
-Sat Nov 29 10:50:28 1997 <monty@monty.pp.sci.fi>
-
-* Added dayofweek() for ODBC.
-* Allow DATE '1997-01-01', TIME '12:10:10' and TIMESTAMP '1997-01-01 12:10:10'
- formats required by ANSI SQL.
- This has the unfortunate side-effect that one can't have columns named
- DATE, TIME or TIMESTAMP anymore :(
-* Changed net_write() to my_net_write() because of name conflict with sybase.
-* Added --no-auto-rehash option to mysql.
-* Added VARBINARY as synonym for VARCHAR BINARY
-
-Wed Nov 26 12:53:41 1997 <monty@monty.pp.sci.fi>
-
-* Added framework for multiple character sorting
-
-Tue Nov 25 04:03:29 1997 <monty@monty.pp.sci.fi>
-
-* Added extra client flag to mysql_real_connect to be compatible with
- MyODBC.
-* Zeev fixed bug in DATE_FORMAT: It forgot to reset the null marker.
-
-Mon Nov 24 20:19:18 1997 <monty@monty.pp.sci.fi>
-
-* Fixed problem with wrong result order when using all of
- DISTINCT + JOIN + ORDER BY + LIMIT.
-
-Sun Nov 23 14:29:54 1997 <monty@monty.pp.sci.fi>
-
-* mysql: edit command now allows one to edit last query in a editor;
- (patch by Zeev Suraski)
-* Recoded all delete item to avoid use of stack space for deletes.
- (For crash-me)
-* Added command: SET SQL_LOG_OFF=1 to not log commands to standard log.
- This will only affect users with process list privileges.
-
-Sat Nov 22 13:08:55 1997 <monty@monty.pp.sci.fi>
-
-* Added stack checking for crash-me :)
- The following failed before: select 1+1+1+1+1+.... (687 times)
-
-Fri Nov 21 01:50:34 1997 <monty@monty.pp.sci.fi>
-
-* Added new patch for Chinese Big5 code.
-* Change that blobs returns the max length for a blob instead of 8192
- to the client as field_length.
-
-Thu Nov 20 15:37:05 1997 <monty@monty.pp.sci.fi>
-
-* fixed bug in range-optimizer that crashed mysql on some queries.
-* table and column name completion for mysql by
- Zeev Suraski and Andi Gutmans
-* Fixed problem with queries that didn't find any records: This happens only
- when using multiple part keys where the first part is a number and some
- other part is a char or varchar.
-* Removed some wrong warning messages from range optimizer
-
-Wed Nov 19 16:41:14 1997 <monty@monty.pp.sci.fi>
-
-* Added new command REPLACE, which works like INSERT but replaces conflicting
- records with the new record. REPLACE INTO TABLE ... SELECT ... works also.
-* Added new commands: CREATE DATABASE db_name and DROP DATABASE db_name
-* Added RENAME option to ALTER TABLE: ALTER TABLE name RENAME AS new_name
-
-Sun Nov 16 21:41:32 1997 <monty@monty.pp.sci.fi>
-
-* The thread stack was overwritten if one tried to create a table with too many
- fields (more than 1000).
-- Table scanning was a bit slower when using LOCK TABLE xxx WRITE. Fixed.
-
-Thu Nov 13 03:12:54 1997 <monty@monty.pp.sci.fi>
-
-* ALTER TABLE forgot BINARY attribute for strings and BLOBS
-* Change comparision of strings to integer to compare as floats instead
- of as integers.
-* Added printing of Access denied errors to log.
-* Fixed some not 100% portable typedefs in mysql_com.h
-* Added Luuk de Boers defines for interval handling.
- This isn't compleat yet.
-
-Wed Nov 12 00:28:58 1997 <monty@monty.pp.sci.fi>
-
-* Added automatic removal of 'ODBC function conversions': {fn now() }
-* Added new function DATE_FORMAT(date_expr,format). The format string is the
- same one that was previously integrated with from_unix_timestamp().
-* Changed from_unix_timestamp() to call function DATE_FORMAT() with format
- element.
-
-Mon Nov 10 18:17:39 1997 <monty@monty.pp.sci.fi>
-
-* Added flag for stupid ODBC applications (like access) that wants found_rows
- instead of affected_rows.
-* Added basic functions for handling av ANSI INTERVAL.
-
-Sat Nov 8 01:20:03 1997 <monty@monty.pp.sci.fi>
-
-* compare with DATE and TIME with NULL didn't work. (IS NULL worked)
-* Added many changes from the Win32 port.
-* new function: DATE_ADD_MM().
-
-Wed Nov 5 13:10:10 1997 Michael Widenius <monty@analytik>
-
-* SORTING on calculated DOUBLE values sorted on integer results instead.
-* SELECT ... WHERE KEY=constant ORDER BY ... didn't use key to retrieve
- records. This was slow because everything was sorted..
-* CHECK isn't a reserved word anymore.
-
-Mon Nov 3 07:55:47 1997 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Allow start of mysqld.cc without a current database.
-* Changed server version to include -debug and -log if compiled with debugging
- and to show that one has a logging enabled.
-
-Sat Nov 1 13:08:00 1997 <monty@monty.pp.sci.fi>
-
-* Added missing expression 'NOT IN'
-* Changed the place where HAVING should be. According to ANSI it should be
- after GROUP BY but before ORDER BY. MySQL 3.20 had it wrongly last.
-* Added Sybase command: USE DATABASE to start using another database.
-* Fixed core dump when one had a wrong password in the password column.
-* Added automatic adjusting of number of connections and table cache size
- if the maximum number of files that can be opened are less than needed.
- This should fix that mysqld doesn't crash even if one hasn't done a
- ulimit -n 256 before starting mysqld.
-* Added limit checks for create table.
-* Added more checks of different errors from net_read for SCO port.
-
-Tue Oct 28 14:30:31 1997 <monty@monty.pp.sci.fi>
-
-* Fixed problem when using big table_caches; MySQL could previously only
- open 256 files.
-
-Mon Oct 27 10:02:19 1997 <monty@monty.pp.sci.fi>
-
-* Added options LINE STARTING WITH to LOAD DATA INFILE and
- SELECT ... into outfile. Now one can do:
-
- LOAD DATA INFILE '/tmp/syslog.sql' INTO TABLE uptime
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED by "'"
- LINES STARTING WITH 'VALUES (' LINES TERMINATED by ');\n' ignore 100 lines
-
-and
- SELECT * from uptime into outfile '/tmp/syslog2.sql'
- FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED by "'"
- LINES STARTING WITH 'INSERT INTO uptime VALUES (' LINES TERMINATED by ');\n'
-
-* Added IGNORE # LINES to LOAD DATA INFILE.
-
-* Allow \N as a shorthand of NULL in SQL statements.
-
-Sun Oct 26 11:34:38 1997 <monty@monty.pp.sci.fi>
-
-* More memory checking.
-* Fixed grouping of functions with many from tables.
-
-Sat Oct 25 01:46:27 1997 <monty@monty.pp.sci.fi>
-
-* New error message so one can check if the connection was lost while
- the command was running or if the connection was down from the start.
-* The mysql command tool now does a automatic reconnect if the connection
- was lost when it does a query.
-* new command: 'mysqladmin debug'. This forces the server to dump out some
- useful information to stdout. Currently it prints all lock information.
-* Rewrite lexer to be faster and more easy to extend.
-
-Fri Oct 24 13:57:06 1997 <monty@monty.pp.sci.fi>
-
-* Fixed bug when like on number key.
-* Added --table option to mysql to print in table format.
- Moved time and row information after query result.
-* Added != as an alias for <>.
-
-Thu Oct 23 16:00:22 1997 <monty@monty.pp.sci.fi>
-
-* Added function VERSION() to make easier logs.
-
-Tue Oct 21 00:09:13 1997 <monty@monty.pp.sci.fi>
-
-* Relase of 3.21.12
-* Added memory checks to all string functions to return NULL if some
- string gets bigger than max_allowed_packet. This is to make MySQL more
- secure.
-* Fixed core dump bug on range optimizer.
-* In some cases doing a join + group + INTO OUTFILE, the result wasn't
- grouped.
-* Now SQL_BIG_TABLES + DISTINCT is also optimized.
-* Changed the syntax of ALTER TABLE ... ALTER COLUMN ident SET DEFAULT ...
- (The DEFAULT keyword wasn't allowed or required before).
-* Added russian error messages.
-
-Mon Oct 20 04:10:53 1997 <monty@monty.pp.sci.fi>
-
-* LIKE with '_' as last character didn't work. Fixed
-* Added many error checks for 'end of memory'
-* Added ENCRYPT() function by Zeev Suraski.
-* Fixed better FOREIGN KEY syntax skipping.
- New reserved words: MATCH, FULL, PARTIAL
-
-Sun Oct 19 23:13:50 1997 <monty@monty.pp.sci.fi>
-
-* Force .log to logfile-name if one uses hostname as logfile.
-* mysqld now allows ip and hostname to the --bind-address option.
-
-Sat Oct 18 22:02:36 1997 <monty@monty.pp.sci.fi>
-
-* Added "SET OPTION CHARACTER SET cp1251_koi8" to enable conversions off
- data to/from different character sets. Currently cp1251_koi8 is the only
- one, but it's now trivial to add others.
- Conversions: strings in the query -> intern set
- fields and items in result -> terminal set
- One can get back to the old one with:
- SET OPTION CHARACTER SET DEFAULT
-* Lots of changes for Win95 port
-
-Fri Oct 17 15:29:44 1997 <monty@monty.pp.sci.fi>
-
-* Changed the create column syntax off NOT NULL to be after the DEFAULT value
- as specified in the ANSI SQL standard. This will make mysqldump with
- NOT NULL and default values incompatible with MySQL 3.20.
-* New reserved words are: BOTH, FOR, LEADING and TRAILING
-* Added a lot of function name alias so one can use the functions with
- ODBC or ANSI SQL92 syntax.
-* Fixed ALTER TABLE person ALTER COLUMN phone SET DEFAULT NULL syntax.
-* Added CHAR and BIT as a synonyms for CHAR(1)
-* Changed the name if the INTERVAL type to ENUM, because INTERVAL is used in
- ANSI SQL.
-* Added extended ANSI SQL TRIM() function.
-* Added CURTIME().
-
-Thu Oct 16 17:26:48 1997 <monty@monty.pp.sci.fi>
-
-* Fixed core dump when updating as user with only select privilige.
-
-Wed Oct 15 04:25:47 1997 <monty@monty.pp.sci.fi>
-
-* INSERT ... SELECT ... GROUP BY didn't work in some cases. On got
- 'Invalid use of group function'
-* When using LIMIT, SELECT now always uses keys instead of record scan.
- This will give better performance on SELECT and a WHERE that matches many
- rows.
-* Added function last_insert_id() to retreive last auto_increment value.
- This is for clients to ODBC that can't use the mysql_insert_id API function.
-* Added option '--flush-logs' to mysqladmin.
-* Added command 'status' to mysql.
-* Moved some messages from libmysql.c to errmsg.c
-
-Mon Oct 13 18:38:01 1997 <monty@monty.pp.sci.fi>
-
-* Tested on BSDI 3.0 with the newest pthread library.
-* Added new group functions: BIT_OR() and BIT_AND().
-* Added compatibility functions: CHECK, REFERENCES.
-* Added BIT as a synonym for CHAR(1) to get better compatibility.
-* Added option ALL to GRANT for better compatibility. (GRANT is still
- a dummy fuction.
-* CHECK is now a reserved word.
-
-Fri Oct 10 17:01:25 1997 <monty@monty.pp.sci.fi>
-
-* Added partly translated dutch messages.
-* Fixed bug in ORDER BY and GROUP BY with NULL columns
-
-Thu Oct 9 10:26:47 1997 <monty@monty.pp.sci.fi>
-
-* Added test of create of table without columns.
-* Release of 3.21.10
-* Fixed a couple of bugs in the range optimizer. Now test-select works.
-
-Tue Sep 30 02:40:42 1997 <monty@monty.pp.sci.fi>
-
-* Added new function: REPEAT(string,count).
-* Added patch of support of Chinese(BIG5).
-* Fixed awful slowdown of libmysql.c when configuring using '--with-debug=yes'
- This affected all clients that got large results from the server.
- (This didn't affect using --quick or mysql_use_result).
-
-Sun Sep 28 20:59:41 1997 <monty@monty.pp.sci.fi>
-
-* Made a new function: mysql_real_connect, that takes two extra arguments:
- port and socket to use on connection.
-* Added text types: TINYTEXT, TEXT, MIDDLETEXT and LONGTEXT.
- These are actually blobs, but all searching is done text independent.
- All old BLOB fields are now TEXT fields.
-* LONG VARCHAR is a synonym for TEXT. LONG BINARY is a synonym for BLOB.
-* 'LONG' is now a reserved word.
-
-Fri Sep 26 16:11:34 1997 <monty@monty.pp.sci.fi>
-
-* Release of 3.21.9
-* Fixed a couple of portable problems with include files.
-* Fixed bug in range calculation that could return empty
- set when searching on multiple key with only one entry (very rare).
-
-Wed Sep 24 15:51:37 1997 <monty@monty.pp.sci.fi>
-
-* Changed thread scope from PROCESS to SYSTEM. This should give better
- scheduling (performance) on Solaris.
-* Fixed duplicated free bug in sql_base with io_cache.
-
-Tue Sep 23 13:05:23 1997 <monty@monty.pp.sci.fi>
-
-* Allow also the old SELECT ... INTO OUTFILE syntax.
-* Fixed bug with group by and select on key with many values.
-
-Mon Sep 22 14:54:00 1997 <monty@monty.pp.sci.fi>
-
-* mysql_fetch_lengths() returned sometimes wrong lengths when one used
- mysql_use_result(). This affected at least some cases of mysqldump --quick.
-
-Sun Sep 21 20:50:07 1997 <monty@monty.pp.sci.fi>
-
-* Fixed memory leak bug in range optimizer.
-
-Sat Sep 20 00:03:51 1997 <monty@monty.pp.sci.fi>
-
-* Allow TIME, DATE and TIMESTAMP as column names.
-* Fixed bug in optimization of WHERE const op field.
-
-Fri Sep 19 12:06:37 1997 <monty@monty.pp.sci.fi>
-
-* Fixed problem when sorting on NULL fields.
-* Added handling of calculation of sum() functions.
-* Added handling of trigometric functions: PI(), ACOS(), ASIN(), ATAN(),
- COS(), SIN() and TAN().
-* Fixed sorting of big tables for 64 bit integers (Alpha).
-
-Fri Aug 29 13:06:32 1997 Michael Widenius <monty@analytik>
-
-* Added option --pid-file=# to mysqld
-* Added date formating to from_unixtime(), originally by Zeev Suraski.
-
-Wed Aug 27 01:35:18 1997 <monty@monty.pp.sci.fi>
-
-* Fixed bug when using 'unsigned long' on Alpa.
-
-Tue Aug 26 03:23:28 1997 <monty@monty.pp.sci.fi>
-
-* Added option --bind-address to mysqld.
-* Changed 'Access denied' to return username and password usage.
-* Changed 'Access to database denied' to return username and database.
-
-Sun Aug 24 22:55:24 1997 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Changed password crypt from 31 bits to 62 bits to make passwords more
- secure.
-* Changed protocol to allow for passing of mysql_errno to client.
-
-Fri Aug 22 18:14:00 1997 <monty@monty.pp.sci.fi>
-
-* Fixed bug in BETWEEN in range optimizer (Did only test = of the first
- argument).
-
-Thu Aug 21 16:40:21 1997 <monty@monty.pp.sci.fi>
-
-* Version 3.21.6
-* Enabled range optimizer for update and delete. Now update and delete can
- use keys again.
-* Fixed bug when using unknown field in group clause.
-
-Tue Aug 19 00:49:13 1997 <monty@monty.pp.sci.fi>
-
-* The range optimizer is now enabled as default. Use msyqld --skip-new
- to disable it.
-* numerous small fixes to the range optimzer and a couple if fixes to
- group and where handling.
-* Added patch from JOERG_HENNE@Non-HP-Germany-om88.om.hp.com to allow
- mit-threads to work on HPUX10. (This patch is regarded alpha)
-
-Fri Aug 15 02:29:21 1997 <monty@monty.pp.sci.fi>
-
-* Remove reverse lookup of hostnames because this takes 2 seconds
- one some machines for every connection!
- This can be enabled with the --secure option to mysqld.
-
-Thu Aug 14 22:40:15 1997 <monty@monty.pp.sci.fi>
-
-* remove HAVING -> WHERE optimization. To fix this one has to change
- all Item_ref fields to Item_fields.
-* Added patch for fast TCP/IP on FreeBSD.
-
-Wed Aug 13 17:14:50 1997 <monty@monty.pp.sci.fi>
-
-* Add optimizing of SELECT DISTINCT .... LIMIT # when there is no
- GROUP or ORDER BY.
-* Changed mysql to only print time information if not silent or if -vvv.
-* Added polish error messages
-
-Sun Aug 10 11:31:10 1997 <monty@monty.pp.sci.fi>
-
-* new function: substring_index(), originally by Zeev Suraski.
-* Added new option to mysqld: -O tmp_table_size=#
-* Removed all use of PTHREAD_MUTEX_INIT and PTHREAD_COND_INIT for
- porting to FreeBSD 3.0 and HPUX.
-
-Thu Aug 7 01:24:50 1997 <monty@monty.pp.sci.fi>
-
-* New function from_unixtime(timestamp) which returns a date string in
- YYYY-MM-DD HH:MM:DD format.
-* New function sec_to_time(seconds) which returns a string in H:MM:SS format.
-
-Sat Aug 2 17:18:22 1997 <monty@monty.pp.sci.fi>
-
-* Fixed some porting issues for OSF1 and for Alpha.
- Now MySQL is know to configure on OSF1 with the Dec compiler,
- after changeing one line in config.h:
- #define SOCKET_SIZE_TYPE int
-
-Wed Jul 30 11:05:39 1997 <monty@monty.pp.sci.fi>
-
-* Added reverse check lookup of hostnames to get better security.
-* Fixed some possible buffer overflows if one uses too long filenames.
-* mysqld doesn't accept hostnames that starts with digits followed by a '.'
- because the hostname may look like a IP.
-* Added option --skip-networking to only allow socket connections.
- (This will not work with MIT threads!)
-
-Tue Jul 29 10:38:55 1997 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Removed wrong free() that killed the server on 'create/drop database'.
-* Changed the name of some mysqld -O options to better names.
-* Added option '-O join_cache_size=#'.
-* Added option '-O max_join_size=#' to be able to set a limit how big queries
- (in this case big = slow) one should be able to handle without specifying
- 'SQL_OPTION OPTION_BIG_SELECTS=1'.
- A # = is about 10 examined records. The default is 'unlimited'.
-* When comparing a TIME, DATE, DATETIME or TIMESTAMP column to a
- constant the constant is converted to a time value before comparing.
- This will make it easier to get ODBC and particularly Access97 to work with
- the above types. It should also make dates easier to use and the compares
- should be quicker than before.
-* added check of too long table names for alias.
-
-Mon Jul 21 16:09:47 1997 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Applied patch from Jochen Wiedmann that fixes that query() in mysqlperl now
- can take queries with \0 in it.
-
-Sat Jul 19 01:11:38 1997 Michael Widenius <monty@monty.pp.sci.fi>
-
-* Store of timestamp with 2 digit year YYMMDD didn't work.
-* Fix that timestamp isn't automaticly updated if set in a update clause.
-* Now the automatic timestamp field is the FIRST timestamp field.
-
-Thu Jul 3 13:34:26 1997 <monty@monty.pp.sci.fi>
-
-* Added check if database name is okey.
-* Addded check if too long table names.
-* SELECT * INTO OUTFILE, which didn't correctly if the outfile already existed.
-* 'mysql' now shows thread id when starting or doing a reconnect.
-* Changed the default sort buffer size from 2M to 1M.
-
-Mon Jun 30 10:18:39 1997 <monty@monty.pp.sci.fi>
-
-* mysqladmin: One can now do 'mysqladmin kill 5,6,7,8'
-* Fixed 'Packets out of order' message. This error come sometimes when the
- server was out of threads/memory. Now the correct message is retrieved by
- the client.
-* Added more checks with thread create for 'out of memory' errors.
-* Added more checks if threads is killed to get faster kill.
-* Changed the default record cache from 512K to 128K to get less problem on
- systems with little memory.
-
-Sat Jun 28 00:18:02 1997 <monty@monty.pp.sci.fi>
-
-* When the max connection limit is reached, one extra connection by a user with
- the PROCESS_ACL privilege is granted.
-
-Fri Jun 27 22:03:24 1997 <monty@monty.pp.sci.fi>
-
-* Added new mysqld option: -O backlog=#
-
-Tue Jun 24 22:08:58 1997 <monty@monty.pp.sci.fi>
-
-* Fixed SELECT DISTINCT when using 'hidden group'. For example:
- SELECT DISTINCT MOD(some_field,10) FROM test GROUP BY some_field;
-* Increased max packet size from 512K to 1024K for client.
-* Removed a lot of unused functions
-
-Mon Jun 23 22:58:07 1997 <monty@monty.pp.sci.fi>
-
-* Changed key_parts to have own field for shortened keys. This gives much
- nicer code in select.
-
-Thu Jun 19 13:09:14 1997 <monty@monty.pp.sci.fi>
-
-* ALTER TABLE now returns warnings from field conversions.
- Changed all numerical fields to check for correct number and
- increment warning counts if the value is wrong.
-
-Wed Jun 18 22:14:36 1997 <monty@monty.pp.sci.fi>
-
-* Fixed buffer overflow when retrieving big packets.
-
-Tue Jun 17 03:26:27 1997 <monty@monty.pp.sci.fi>
-
-* Port changed to 3306 (got it reserved from ISI).
-
-Mon Jun 16 15:46:42 1997 <monty@monty.pp.sci.fi>
-
-* All double are now rounded before storad as integer values.
-* Fixed bug when using: SELECT WHERE A=const1 OR A=const2 OR A=const3,
- and const1 = const3. In this case a key over A=const1 was wrongly used and
- A=const2 wasn't used.
-* Added a fix for Visual Fox Base so that any schema name from a table
- specification is automaticly removed.
-
-Sun Jun 15 12:47:23 1997 <monty@monty.pp.sci.fi>
-
-* The thr_alarm array is now initialized based on number of connections
-* Changed some memcpy() to bmove() to get rid of some warnings from purify.
-* Changed the sql_yacc.c to drop schema name from table name. This is a crude
- patch to get VFP
-
-Sat Jun 14 12:04:59 1997 <monty@monty.pp.sci.fi>
-
-* fixed missed ptr variable in filesort.
-* Fixed wrong tablename and record count EXPLAIN.
-* Changed the 'key use' test to prefere keys even more over full join.
-* Fixed LIKE to work for binary strings.
-
-Fri Jun 13 13:38:14 1997 <monty@monty.pp.sci.fi>
-
-* New function char(num,....).
-
-Wed Jun 11 14:53:17 1997 <monty@monty.pp.sci.fi>
-
-* All field types tested with extrema values. date_time and timestamp
- now require at least year, month and day on insert.
-
-Mon Jun 9 01:23:36 1997 <monty@monty.pp.sci.fi>
-
-* Added French error messages (by Therrien, Gilbert). English is still default.
-* Added option '--skip-name-resolve' to get mysqld to use only IP's to
- autenticate a host. 'localhost' will still be used for local UNIX sockets.
-* Removed the between() function. On should use the 'col BETWEEN a AND b'
- syntax instead.
-
-Sun Jun 8 11:05:46 1997 <monty@monty.pp.sci.fi>
-
-* New function ASCII.
-
-Sat May 31 01:00:18 1997 <monty@monty.pp.sci.fi>
-
-* host names are now compared case insensitive.
-
-Wed May 28 13:04:00 1997 <monty@monty.pp.sci.fi>
-
-* HAVING is added to WHERE if there is no grouping.
-* MySQL now doesn't anymore have to use a extra temporary table when sorting
- on functions or SUM functions.
-
-Tue May 27 00:54:51 1997 <monty@monty.pp.sci.fi>
-
-* Added function to print a item for debugging purposes.
-* Fixed bug that one couldn't use 'table_name.field_name' in UPDATE.
-* Removed init code with reset some of the mysqld -O variables to default after
- they where set by start options.
-
-Thu May 22 14:52:26 1997 <monty@monty.pp.sci.fi>
-
-* Added varbinary syntax: 0x###### which can be used as a string (default) or a
- number.
-
-Sun May 18 22:00:58 1997 <monty@bitch.sci.fi>
-
-* mysqldump: added options to lock tables and specify many tables to dump
-* Add support of NULL fields in filesort
-* SELECT with COUNT(),MIN() .... with no matching rows now returns 1 row.
-
-Sat May 17 22:06:29 1997 <monty@bitch.sci.fi>
-
-* New operator IN. This uses a binary search to find a match.
-* Added 'SET OPTION SQL_BIG_TABLES= (0 | 1). Setting this to 1 will force
- all temporary tables to disk. This will allow one to do big selects that
- ordinary would give a 'table full' error.
-
-Fri May 16 18:53:21 1997 <monty@bitch.sci.fi>
-
-* New command LOCK TABLES table_name [alias] (READ | WRITE), ....
-
-Wed May 14 14:33:07 1997 <monty@bitch.sci.fi>
-
-* Renamed FIELD_TYPE_CHAR to FIELD_TYPE_TINY
-
-Mon May 12 09:54:24 1997 <monty@bitch.sci.fi>
-
-* Added command --log-update to get a update log for incremental backups.
-* log file rotation for mysqld.
-* log file for incremental backups
-* new command: DESCRIBE SELECT ....
-* Removed mysql_reload() and added mysql_refresh() instead.
- Left a define to get old source to compile.
-
-Fri May 9 10:41:36 1997 <monty@bitch.sci.fi>
-
-* All functions now regards a binary type as 'sticky'.
-* The time is now only requested once at start of each query.
-* Splitted item_func.cc in two tables to get around that gcc uses too
- much memory compiling it.
-* Changed MIN() and MAX() to return the original type.
-* Fixed bug in acl with anonymous user: Now if one gets accepted by the user
- table as a empty user name, the user name is set to '' when checking against
- the 'db' and 'host' tables.
-* calculate all const expressions in the first optimizer pass.
-
-Tue May 6 19:16:56 1997 <monty@bitch.sci.fi>
-
-* Fixed ORDER BY bug when selecting on very small tables that made the
- optimizer use a full join.
-
-Mon May 5 00:15:52 1997 <monty@bitch.sci.fi>
-
-* Added use of table alias in insert, delete and update.
-* Removed FIELD_TYPE_TINY_BLOB, FIELD_TYPE_MEDIUM_BLOB, FIELD_TYPE_LONG_BLOB,
- FIELD_TYPE_VAR_STRING from client code.
-* Change syntax of SELECT .. WHERE ... INTO OUTFILE .. to the more standard
- SELECT .. INTO OUTFILE 'name' WHERE ...
-
-Thu May 1 23:16:14 1997 <monty@bitch.sci.fi>
-
-* Added new API functions:
- mysql_row_seek(),mysql_row_tell() and mysql_field_tell().
- mysql_field_seek() now returns old offset.
-* Added expr BETWEEN expr2 AND expr3.
-
-Sun Apr 27 16:16:17 1997 <monty@bitch.sci.fi>
-
-* Changed range() detection to get queries on prefix to works faster.
- Now SELECT name FROM table WHERE name="prefix" is quick even if there
- are lots of rows where name starts with prefix.
-* Fixed crash with shutdown and --log-isam
-* Added group function STD() (standard derivation).
-* mysql.cc: Fixed that NULL columns are always at least 4 wide for nicer output
- of NULL values.
-* Fixed that calculations that are not in GROUP BY works as expected.
- (ANSI SQL extension)
- Example: SELECT id,id+1 FROM table GROUP BY id
-
-Thu Apr 24 13:41:01 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* Fixed convert bug which got mysqld to core dump with Aritmetic error on
- Sparc-386
-
-Wed Apr 23 12:11:05 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* Added tty password to mysqlshow.c
-
-Tue Apr 22 15:44:11 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* The test of using MYSQL_PWD was reversed. Now MYSQL_PWD is enabled as default
- in the default release
-
-Sun Apr 20 14:36:39 1997 <monty@bitch.sci.fi>
-
-* Now one usually only have to give --basedir to mysqld. All other paths
- are relative in a normal installation.
-* BLOBs contained sometimes garbage when used with a SELECT on more than
- one table and ORDER BY.
-* Added option --unbuffered to mysql. (For new mysqlaccess)
-* 'select *' without tables crashed server.
-* When using overlapping (unnecessary keys) and join over many tables
- the optimizer could get confused and return 0 records.
-* Changed safe_mysqld to allow one to move installed releases.
-
-Sun Apr 13 10:40:50 1997 <monty@bitch.sci.fi>
-
-* Release 3.20.17
-* Added new function unix_timestamp([timestamp_column])
-
-Sat Apr 12 11:27:57 1997 <monty@bitch.sci.fi>
-
-* Fixed memory over run bug when using selects with many brace levels.
-* Change from_days() and weekday() to also take a full timestamp or
- a datetime as argument. Before they only took a number of type YYYYMMDD or
- YYMMDD.
-
-Wed Apr 9 13:22:24 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed stack usage to use less memory.
-* All communication packages and row buffers are now alloced on demand.
- The default communication buffers are now smaller than before.
-* count(field) where field could have a NULL value didn't work.
-* IS NULL and IS NOT NULL now work in the WHERE.
-* BLOBs now work in the WHERE.
-* Remove pre-space from numbers when writing decimal() coulmns to file.
-* INSERT INTO ... SELECT .. WHERE could give the error 'Dupplicated field'
-
-Tue Apr 8 16:14:54 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added commands SET OPTION SQL_SELECT_LIMIT=# to provide framework
- for options and to get some ODBC things to work.
-* Fixed bug in SELECT ... two tables ... GROUP BY
-* Fixed bug in INSERT ... SELECT ... GROUP BY
-* Fixed bug in acl: To use FILE_PRIV one also had to have SELECT PRIV
- in the user grant table.
-* Fixed fatal bug in ranged querie with OR when one part of the query didn't
- have any matching records.
-
-Mon Apr 7 16:03:00 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Now connections are allowed even if hostname isn't found.
- In this case all hostname checks are done on IP.
-* When doing insert on timestamps, the timestamp was set to the
- current time even if updated by a value.
-* Fixed LOAD DATA.. that if one has COLUMN TERMINATED BY to be same as
- LINE TERMINATED BY, then LINE TERMINATED BY is set to a empty string.
- This wasn't a bug, but a common mistake when reading columns separated
- with newlines.
-
-Sun Apr 6 22:37:53 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed definition of function ELT as it should have been:
- ELT(index,element,element,element....) now returns the index:s
- element in the list. The first element has index 1.
- FIELD(find,string,string,string) searches after the 'find' string
- in the string list and returns a index to the found string.
- The strings are compared case insensitive.
-* Added some tests to safe_mysqld to make it 'safer'
-
-Fri Apr 4 02:17:40 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* When sorting the db grant table, host wasn't sorted.
-
-Wed Apr 2 03:00:14 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed case 'WHERE key_num_column = "string"'
-* LIKE was case sensitive in some places and case insensitive in other.
- Now LIKE is always case insensitive.
-* Fixed bug in select optimizer when using many tables with the same
- column used as key to different tables.
-
-Sun Mar 30 21:22:39 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* mysql.cc; Allow '#' anywhere on the line.
-
-Thu Mar 27 02:42:12 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added new latin2 and Russian KOI8 character tables.
-* Added support for a dummy GRANT command satisfy Powerbuilder.
-
-Wed Mar 26 03:03:07 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Release of 3.20.15
-* Removed possible loop when thread waits for command from client
- and fcntl() fails. Thanks to Mike Bretz for finding this bug
-
-Tue Mar 25 18:03:15 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed alarm loop in mysqld.cc because shutdown didn't always
- succeed in Linux.
-* Removed use of termbits from mysql.cc This conflicted with glibc 2.0
-* Fixed syntax error in get_password.c (for BSD). Added flush of line.
-* Added test if 'linux' style gethostbyaddr_r in mysqld.cc
-* Fixed bug when doing a select as superuser without a database.
-* Fixed bug when doing SELECT with group calculation to outfile.
-
-Mon Mar 24 16:03:01 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Release of 3.20.14
-* Added new function SOUNDEX()
-* If one gives '-p' or -password to mysql or mysqladmin without an argument,
- the password will be asked from the tty.
-
-Sun Mar 23 00:19:42 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Sometimes when doing a reconnect on a down connection this succeded
- first on second try. Fixed by removing handling of SIGPIPE in client.
-* When adding a auto_increment key with ALTER_TABLE on got the error:
- 'Can't write, duplicate key'.
-
-Sat Mar 22 22:55:12 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* AVG() gave too small value on some selects with GROUP BY and ORDER BY.
-
-Fri Mar 21 12:27:32 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added new DATETIME type (by Giovanni Maruzzelli <maruzz@matrice.it>)
-* Fixed that define 'DONT_USE_DEFAULT_FIELDS' works
-* Added default password from MYSQL_PWD. (by Elmar Haneke)
-* Changed C++ code to be compatible with Sun Workshop
-
-Thu Mar 20 12:28:06 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* Changed to use a thread to handle alarms instead of signals on Solaris to
- avoid race conditions.
-* Fixed default length of signed numbers. (George Harvey <georgeh@pinacl.co.uk>)
-* Added commando 'kill' to mysqladmin to kill a specific mysql thread.
-
-Wed Mar 19 12:21:33 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* sql_base.cc: Allow anything for CREATE INDEX.
-
-Mon Mar 17 19:54:11 1997 Michael Widenius TcX DataKonsulter AB <monty@analytik>
-
-* Add prezeros when packing numbers to DATE, TIME and TIMESTAMP.
-* Fixed the OR bug for good.
-
-Fri Mar 14 11:46:54 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Release 3.20.13
-* Added changes by bonis@kiss.de to allow WHERE const op field
-* Fixed bug in mysql.c when reading long commands from batch.
-* mysqldump.c
- Changed newlines, return and ASCII 0 to "\n", "\r" and "\0",
- to allow restoring of columns with these.
-
-Thu Mar 13 20:02:53 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed bug in select with and-or levels.
-
-Mon Mar 10 04:04:03 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added support for Slovenian characters.
-* Fixed bug with limit and order by.
-* Allow order and group on items that isn't in the select list.
-
-Sun Mar 9 00:21:36 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added ANSISQL94 DATE and TIME types. Changed TIMESTAMP fields to work better
- when updateing it with a number.
-
-Sat Mar 8 20:19:21 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Allow setting of timestamp values in INSERT.
-* Fixed bug with SELECT ... WHERE ... = NULL.
-* Added changes for glibc 2.0
-
-Fri Mar 7 07:53:01 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed bug in alter table when changeing a not null field to allow NULLs.
-* Added HAVE_READDIR_R as a define which can be removed if one has
- a broken readdir_r implementation (Sparc/Linux).
-
-Thu Mar 6 21:06:02 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added some ANS92 synonyms as field types to CREATE TABLE.
- CREATE TABLE now allows FLOAT(4) and FLOAT(8) to mean FLOAT and DOUBLE.
-
-Wed Mar 5 00:41:29 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Release 3.20.11
-* Added sync of records count in sql_update. This fixed slow updates on first
- connection. (Thanks to Vaclav Bittner for the test)
-* Changed temporary file prefix from UN to MY.
-* When using SELECT .... INTO OUTFILE all temporary tables are ISAM instead of
- HEAP to allow big dumps.
-* Changed date functions to be 'string functions'. This fixed some 'funny'
- side effects when sorting on dates.
-
-Tue Mar 4 23:07:03 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed FOREIGN KEY to not create a key. Now it's only for compability.
-* Extended ALTER TABLE according to SQL92.
-* Some minor compability changes.
-* Added --port and --socket to all utility programs and mysqld.
-
-Sat Feb 15 01:27:51 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added Oracle command DESCRIBE (DESC) as a synomym for some SHOW commands:
- DESC table_name <==> SHOW FIELDS FROM table_name
- DESC table_name column <==> SHOW FIELDS FROM table_name LIKE 'column'
- DESC table_name 'column' <==> SHOW FIELDS FROM table_name LIKE 'column'
- mysql.cc thought that tinyblob, mediumblob and longblob was numerical.
- (Was right adjusted)
-
-Thu Feb 13 00:49:29 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* mediumblob didn't work.
-* Fixed safe_mysqld and make_binary_distribution to work better.
-* ALTER TABLE and changeing a BLOB to a CHAR() added some garabage at
- string end.
-
-Wed Feb 12 16:10:49 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* new insert type: INSERT INTO ... SELECT ....;
-
-Tue Feb 11 12:58:36 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed some defines to get mysql to compile on freebsd 2.0 (intel)
-* Removed all _A() from prototype declaration.
-* Removed use of ulong in mysql.h and mysql_com.h
-* Changed mysqldump to dump keynames.
-* SELECT ... INTO OUTFILE 'test' create the file in the base directory
- instead in database directory (if one didn't give a full path)
-* A primary key is now defined as a key with name PRIMARY or the first
- unique key if there doesn't exist a key with name PRIMARY.
-
-Mon Feb 10 00:40:48 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed leak bug when using LOAD DATA into a blob with is sometimes NULL.
-* DROP TABLE can now take a list of tables.
-* If a databas was crashed, in some cases a read of the wrong record
- was used as a 'end of file', instead of returning an error.
-
-Sat Feb 8 00:16:07 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* merged structs field_t and FIELD to FIELD.
-
-Fri Feb 7 12:49:01 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* version 3.20.9
-* Alter table didn't copy null bit. This resulted that NULL fields where
- always NULL.
-* CREATE didn't take numbers as DEFAULT.
-
-Wed Feb 5 13:28:19 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* New scripts 'add_file_priv' which add the new field 'file_priv'
- to the user table. This scripts must be executed if one wants to
- use the new SELECT ... INTO and LOAD DATA INFILE... commands
- with a version of mysql less than 3.20.7.
-* Found bug in locking code when another thread got a table opened
- by another thread. This could make a thread block forever wating
- for a write lock.
-
-Tue Feb 4 00:57:24 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed select_test.c and insert_test.c to include config.h
-
-Mon Feb 3 00:42:08 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Add an optional keyname for all key declarators.
-
-Sat Feb 1 19:02:43 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added command 'status' to mysqladmin for short logging.
-* Increased max keys to 16 and max key parts to 15.
-
-Fri Jan 31 00:05:23 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added ANSI92 extended ALTER TABLE statement.
-* Changed all locking code to detect ALTER table after one got a lock.
- Tables are automaticly reopened if ALTERed.
-* Changed some structs to classes to get better code when using CREATE TABLE.
-
-Thu Jan 30 01:12:13 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added new privilege to the user grant table: file_priv
-* Added some compitibility changes to mysql.cc
-* Added new syntax for creating keys with is a sub part of some field.
-* Did a lot of changes to get around bug when comparing fields of
- different lengths. Hope I didn't break something else :)
-* Added long options to mysqldump.
-* Added new function NOW().
-
-Wed Jan 29 15:51:22 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added option -k for mysqlshow to get key info for table.
-* Changed some definitions from int to uint in mysql.h to get fewer warning
- with prolint.
-
-Mon Jan 27 02:01:29 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added sql command 'load data infile...' for export from textfiles.
-* Added new API function mysql->info to pass info to client.
-* Added INTO OUTFILE as option to select to get result to file.
-
-Fri Jan 24 14:56:19 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Relase 3.20.5-beta
-* Got first version to work which MIT-threads.
-* Added long options to mysqld
-* mysqld now starts without system locking if compiled with MIT threads.
-* Added new sql function RAND([init])
-* Changed sql_lex to handle \0 unquoted, but the client can't send
- the query through the C api, because it takes a str pointer.
- one have to use mysql_real_query() to send the query.
-
-Thu Jan 23 00:33:26 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added API function: mysql_get_client_info
-* mysqld now uses the N_MAX_KEY_LENGTH from nisam.h as the max allowed key
- length.
-* The following now works: "select filter_nr,filter_nr from filter order by
- filter_nr"
- Before you got the error: "Column: 'filter_nr' in order clause is ambiguous"
-
-Wed Jan 22 14:48:58 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed fctnl flag O_NDELAY to O_NONBLOCK (Posix, and to get MIT threads
- to work)
-
-Tue Jan 21 12:31:17 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* mysql now outputs \0 \t \n and \\ when writing tab separated output.
- when encountering ascii 0, tab, newline or \. This is to allow printing of
- binary data in a portable format.
- To get old behavior use -r (or --raw).
-* Added long options to mysqladmin, mysql and mysqlshow.
-* Added german error messages (60 of 80 error messages translated)
-* Added new api function: mysql_fetch_lengths(MYSQL_RES *) which
- returns a array of of column lengths (of type uint).
-
-Sat Jan 18 23:59:53 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed bug with IS NULL in where clause.
-
-Fri Jan 17 12:14:38 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed the optimizer a little to get better results when searching on a key
- part.
-* Added select option STRAIGHT_JOIN to tell the optimizer that it should join
- tables in the given order.
-
-Thu Jan 16 00:55:41 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added support of comment starting with '--' in mysql.cc (Postgres syntax)
-* You can now have select_expressions and table columns in a select which
- are not used in the group part. This makes it efficient to implement lookups.
- If the not used column is not a constant for the group the column value
- is unspecified.
- Example: SELECT id,lookup.text,sum(*) FROM test,lookup
- WHERE test.id=lookup.id group by id;
-
-* Fixed bug in sum(function) (Could make core dump)
-* Changed auto_increment according to SQL_SYNTAX:
- INSERT into table (auto_field) values (0) inserted 0, but the SQL_SYNTAX
- statied it should insert a auto_incremnt value.
-
-Wed Jan 15 10:42:09 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* mysqlshow.c: Added number of records in table. Had to change the client code a
- little to fix this.
-* mysql now allows double '' or "" in strings for embedded ' or ".
-* Changed copyright text in mysqlshow and mysqladmin.
-
-Mon Jan 13 02:33:09 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Relase 3.20.3
-* Using the new readline library from bash.
-* Updated a lot of text files.
-* safe_mysqld and mysql.server changed to be more compatible between the
- source and the binary releases.
-
-Sun Jan 12 18:23:30 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* LIMIT takes now one or two numerical arguments.
- If one argument the argument indicates the maximum number of rows in a result.
- If two arguments the first arguments says the offset to the first row to return,
- the second is the maximum number of rows.
- With this it's easy to do a poor mans next page/previous page www application.
-* Changed name of SQL function FIELDS to ELT.
-* Made SHOW COLUMNS a synonym for SHOW FIELDS.
- Added compatibility syntax FRIEND KEY to create table. This creates in mysql
- a non unique key on the given columns.
-* Added CREATE INDEX and DROP INDEX as compatibility functions. In mysql
- CREATE INDEX only checks if the index exists and gives an error if it doesn't
- exists. DROP INDEX always succeeds.
-
-Sat Jan 11 00:44:29 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* mysqladmin.c: Added client version to version info.
-
-Fri Jan 10 20:30:04 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed core dump bug in sql_acl (core on new connection).
-* Removed host,user and db tables from database test in the distribution.
-* FIELD_TYPE_CHAR can now be signed (-128 - 127) or unsigned (0 - 255)
- Before it was always unsigned.
-
-Thu Jan 9 00:02:03 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Changed name from mysqllib to mysqlclient for mysql client lib.
-* The following failed: concat(1,concat(2),2).
- Could not call a variable argument function in a variable argument count
- function. Fixed.
-
-Wed Jan 8 15:58:49 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* weekday() returned wrong day 6 of 7 times.
-
-Mon Jan 6 23:49:31 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* changed a lot of source to get mysqld to be compiled with SUNPRO compiler.
-* sql functions must now have a '(' directly after the function name.
- user '(' is now regarders as an identifier and a '('
-
-Fri Jan 3 12:18:14 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed possible bug when sorting with float and double.
- Changed static sort_length to thread variable. This may have caused some
- big sorts to fail when running two simultaneous sorts.
-* Changed sql function INTERVALL() to INTERVAL().
-
-Wed Jan 1 16:18:30 1997 Michael Widenius <monty@bitch.sci.fi>
-
-* Added some portability files for testing with RTS threads.
-* Lot of changes for configure.
-
-Sun Dec 29 13:26:52 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Remove Makefile-linux-pl and Makefile-solaris-pl from the binary distribution.
- Now only Makefile.PL is needed.
-
-Sat Dec 28 22:41:09 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed that insert with a timestamp set to NULL works. (This is for a cleaner
- syntax)
-
-Fri Dec 27 01:28:02 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysqld now has english & swedish error messages.
-* unireg files moved to sql directory changed to c++.
-
-Thu Dec 26 11:57:57 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysqld: Added option 'b' for mysql basedir. All given directories is
- prefixed with this if not given with hard path.
- added option '-L' (language). Default is 'english/'
- Moved all unireg files to sql directory.
-
-Fri Dec 20 11:05:37 1996 Michael Widenius TcX DataKonsulter AB <monty@ozelot>
-
-* Changed lex to allow a database name, table name and field name to start with
- number or '_'.
-
-* mysqldump should now be able to dump all field types.
- Changed 'show fields from table' to be fully compatible with create.
-* Some bugs when parsing 'create table' fixed. (Blobs and timestamps was effected)
-* Fixed one possible dead lock bug when using many tables.
-* Changed a lot for configure
-
-Sun Dec 15 02:29:53 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Added new functions: INSERT(),RTRIM(),LTRIM(),FORMAT().
-
-* New relase 3.19.5
-* Added functions DATABASE(),USER(),POW(),LOG10() (needed for ODBC).
-
-Sat Dec 14 10:10:42 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* In a WHERE with a ORDER BY on fields from only one table the table is
- now preferred as first table in a multi-join.
-* HAVING and IS NULL or IS NOT NULL now works.
-* a group on one column and a sort on a group function (SUM,AVG...) didn't
- work together. Fixed.
-
-Fri Dec 13 07:20:47 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysqldump: Didn't send password to server.
-
-* New relase 3.19.4
-* Fixed horrible locking bug when inserting in one thread and reading
- on another thread.
-* Fixed one-off decimal bug. 1.00 was outputed as 1.0
-* Added attribute 'Locked' to process list as info if a query is
- locked by another query.
-* Fixed full magic timestamp. Timestamp length may now be 14,12,10,8,6,4 or 2.
-
-Thu Dec 12 18:14:57 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* sort on some number functions could be sorted wrong on last number.
-* if(arg,syntax_error,syntax_error) crashed.
-* added functions ceiling() and round(), exp(), log() and sqrt()
-* enchanted BETWEEN to handle strings.
-
-Wed Dec 11 09:09:02 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* MYODBC: Sometimes password test failed because of faulty charactermap in
- windows.
-
-Mon Dec 9 12:50:56 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* new relase 3.19.3
-* Fixed that select with grouping on blob's doesn't return wrong blob info.
- grouping, sorting and distinct on blobs will not yet work as expected
- (Probably it will group/sort by the first 7 characters in the blob)
- Groping on formulas with a fixed string size (use mid on blob) should work.
-* When doing a full join (no direct keys) on multiple tables with blob fields,
- the blob was garbage on output.
-* Fixed distinct with calculated columns.
-
-Sun Dec 8 19:53:24 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed bug when allocation string for group
-* new release 3.19.2
-* mysqldump.c: Didn't output ' around blobs.
-
-Sat Dec 7 13:00:43 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Added user flag to mysqldump & mysqlshow.
-* ODBC: Added full support of SQLGetInfo(). Fixed limit bug (from 1.0.3).
- myodbc-1.0.4 released
-
-Fri Dec 6 01:35:22 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* ODBC: Added more support SetStmtOptions(). Added more debugging code
- myodbc-1.0.3 released
-
-Tue Dec 3 22:12:30 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Added 'max_connections' and 'table_cache' as start variables to mysqld.
-* Changed weights in join optimizer: Now prefers to use keys even more:
- Before the optimizer would prefer to do a full join on small tables
- (< 300 records), even if there was a usable key.
-
-Mon Dec 2 00:17:42 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* new release 3.19.1
-* Fixed bug when joining tables without keys and null fields and varchars.
- (mysqld hang)
-* Fixed output of 'mysql show'. All fields was 'unsigned zerofill'.
-
-* new release 3.19.0
-* Added new column specifier AUTO_INCREMENT.
-* Changed format of sql command 'show fields'.
-* Changed mysqlshow to use sql command 'show fields' to get more info.
-* Added synonym RLIKE for REGEXP to be compatible with mSQL
-
-Sun Dec 1 12:53:05 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* item_func.cc (fix_fields): Fixed new bug when calculation and levels.
- Crashed stack when optimizing where! (fatal bug in 3.18.1)
-
-Fri Nov 29 00:32:09 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Distribution 3.18.1
-* Fixed optimizeing bug.
-* New ODBC version with traceing in all functions with isn't supported yet
- for easier debugging. Added NO WARRANTY info.
- Released as 1.0.2
-
-Wed Nov 27 17:18:51 1996 Michael Widenius TcX DataKonsulter AB <monty@ozelot>
-
-* Added Henry Spencer's regexp in 'field REGEXP string'. Can only be used
- in select_expression or HAVING until I fix the where clause.
-
-Mon Nov 25 20:01:05 1996 Michael Widenius TcX DataKonsulter AB <monty@ozelot>
-
-* Created files: CREDITS, PUBLIC. Updated FAQ, README, TODO, SQL_SYNTAX...
-* Done a lot of testing on HAVING.
-
-Sun Nov 24 00:45:07 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysql didn't stop on error in batch mode even if -f wasn't used.
-* Fixed DBD Makefile.PL for linux
-* Added a function.tst & function.res (test and result file of mysql functions)
-* libmysql.c: Added some checking for calls after connection has gone done.
-* Implemented HAVING with full expr syntax
-* Changed operators '=,
-
-Sat Nov 23 20:52:42 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* SQL_SYNTAX added 'like' as a boolean expression in select.
-* mysqladmin.c: 'mysqladmin garbage' didn't give an error.
-* sql_insert.cc: If one read a deleted record and did a insert with all fields
- then the new record was marked deleted.
-* perl DBI interface ported.
-
-Thu Nov 21 00:58:44 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysql only used the TCP connection, no socket was ever created
-* There was a bug in when reading from getenv(MYSQL_TCP_PORT)
-* Added some more start-logging to check for port & socket.
-* If something got wrong at startup some threads was kept alive in Linux
-* If argument -h to mysqld is a relative path, change it to './'
-* Search after the 'unireg' directory from: current dir,
- mysqld program dir/.. and in env(MY_BASEDIR_VERSION)
-* Added longlong support to Linux
-* Added copyright notices to all files. Everything should be ready for
- distribution.
-
-Wed Nov 20 19:03:02 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Added function IF.
-* Added select without FROM clause (for easy test of functions)
-
-Tue Nov 19 11:48:55 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* mysql.c: Sometimes 'in-string' was not initialized.
-* linux distribution
-
-Mon Nov 18 13:47:09 1996 Michael Widenius <monty@bitch.sci.fi>
-
-* Fixed blob:s to work (as varchar) in ODBC (myodbc-1.0.1.zip)
-* Added option -O to set buffer sizes to mysqld
-
-Wed Nov 13 15:21:14 1996 Michael Widenius <monty@monty.pp.sci.fi>
-
-* New sql functions: REPLACE, LCASE and UCASE
-* hacked search on '%xxx' to work.
-
-Tue Nov 12 00:52:35 1996 Michael Widenius <monty@monty.pp.sci.fi>
-
-* mysql.cc: Fixed problems with strings containing not backslashed ' or ".
-
-Mon Nov 11 14:52:30 1996 Michael Widenius <monty@monty.pp.sci.fi>
-
-* added braces to where clause. Change where to use items.
-
-Wed Nov 6 00:17:37 1996 Michael Widenius <monty@analytikerna.se>
-
-* added PRIMARY KEY, KEY and UNIQUE to sql create.
diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc
index d9c924b5a3c..891cf18ee53 100644
--- a/sql/des_key_file.cc
+++ b/sql/des_key_file.cc
@@ -104,4 +104,15 @@ error:
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
DBUG_RETURN(result);
}
+
+
+void free_des_key_file()
+{
+ if (initialized)
+ {
+ initialized= 01;
+ pthread_mutex_destroy(&LOCK_des_key_file);
+ }
+}
+
#endif /* HAVE_OPENSSL */
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index b1cb45be6b3..a25aedaa89f 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -830,6 +830,7 @@ innobase_end(void)
err = innobase_shutdown_for_mysql();
hash_free(&innobase_open_tables);
my_free(internal_innobase_data_file_path,MYF(MY_ALLOW_ZERO_PTR));
+ pthread_mutex_destroy(&innobase_mutex);
if (err != DB_SUCCESS) {
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 0a419879e3a..19e97c60dd3 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -497,7 +497,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
{
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
- sql_print_error("Warning: Retrying repair of: '%s' without quick",
+ sql_print_error("Note: Retrying repair of: '%s' without quick",
table->path);
continue;
}
@@ -505,7 +505,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
if ((param.testflag & T_REP_BY_SORT))
{
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
- sql_print_error("Warning: Retrying repair of: '%s' with keycache",
+ sql_print_error("Note: Retrying repair of: '%s' with keycache",
table->path);
continue;
}
@@ -515,7 +515,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
!(check_opt->flags & T_VERY_SILENT))
{
char llbuff[22],llbuff2[22];
- sql_print_error("Warning: Found %s of %s rows when repairing '%s'",
+ sql_print_error("Note: Found %s of %s rows when repairing '%s'",
llstr(file->state->records, llbuff),
llstr(start_records, llbuff2),
table->path);
diff --git a/sql/hostname.cc b/sql/hostname.cc
index be035e52ac1..ed56e199c3c 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -27,7 +27,9 @@
extern "C" { // Because of SCO 3.2V4.2
#endif
#if !defined( __WIN__) && !defined(OS2)
+#if !defined(__NETWARE__)
#include <sys/resource.h>
+#endif /* __NETWARE__ */
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/sql/item.h b/sql/item.h
index 67dcc8ad7b8..b690807691f 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -86,6 +86,9 @@ public:
virtual bool is_null() { return 0; }
virtual unsigned int size_of()= 0;
virtual void top_level_item() {}
+ virtual void set_result_field(Field *field) {}
+ virtual bool is_result_field() { return 0; }
+ virtual void save_in_result_field(bool no_conversions) {}
};
@@ -356,12 +359,19 @@ public:
table_map used_tables() const { return 1; }
virtual void fix_length_and_dec()=0;
unsigned int size_of() { return sizeof(*this);}
+ void set_result_field(Field *field) { result_field= field; }
+ bool is_result_field() { return 1; }
+ void save_in_result_field(bool no_conversions)
+ {
+ save_in_field(result_field, no_conversions);
+ }
};
class Item_ref :public Item_ident
{
public:
+ Field *result_field; /* Save result here */
Item **ref;
Item_ref(char *db_par,char *table_name_par,char *field_name_par)
:Item_ident(db_par,table_name_par,field_name_par),ref(0) {}
@@ -407,6 +417,12 @@ public:
enum Item_result result_type () const { return (*ref)->result_type(); }
table_map used_tables() const { return (*ref)->used_tables(); }
unsigned int size_of() { return sizeof(*this);}
+ void set_result_field(Field *field) { result_field= field; }
+ bool is_result_field() { return 1; }
+ void save_in_result_field(bool no_conversions)
+ {
+ (*ref)->save_in_field(result_field, no_conversions);
+ }
};
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 78885038654..02ae03b217f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1509,6 +1509,7 @@ void item_user_lock_init(void)
void item_user_lock_free(void)
{
hash_free(&hash_user_locks);
+ pthread_mutex_destroy(&LOCK_user_locks);
}
void item_user_lock_release(ULL *ull)
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index bdf48b3ac54..222dd0a3a25 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1089,7 +1089,7 @@ bool Item_sum_count_distinct::add()
if (always_null)
return 0;
copy_fields(tmp_table_param);
- copy_funcs(tmp_table_param->funcs);
+ copy_funcs(tmp_table_param->items_to_copy);
for (Field **field=table->field ; *field ; field++)
if ((*field)->is_real_null(0))
diff --git a/sql/log.cc b/sql/log.cc
index 58f5298dad0..01bd08956fb 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -97,8 +97,15 @@ MYSQL_LOG::MYSQL_LOG()
MYSQL_LOG::~MYSQL_LOG()
{
+ cleanup();
+}
+
+void MYSQL_LOG::cleanup()
+{
if (inited)
{
+ close(1);
+ inited= 0;
(void) pthread_mutex_destroy(&LOCK_log);
(void) pthread_mutex_destroy(&LOCK_index);
(void) pthread_cond_destroy(&update_cond);
@@ -1430,6 +1437,10 @@ void MYSQL_LOG:: wait_for_update(THD* thd)
at once after close, in which case we don't want to
close the index file.
We only write a 'stop' event to the log if exiting is set
+
+ NOTES
+ One can do an open on the object at once after doing a close.
+ The internal structures are not freed until cleanup() is called
*/
void MYSQL_LOG::close(bool exiting)
diff --git a/sql/my_lock.c b/sql/my_lock.c
index 4d451fcff22..7f47256703a 100644
--- a/sql/my_lock.c
+++ b/sql/my_lock.c
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __EMX__
+#if defined(__EMX__) || defined(__NETWARE__)
#include "../mysys/my_lock.c"
#else
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 75bf4e97634..4076008cd04 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -397,7 +397,7 @@ int mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &list,COND *conds,
ulong select_type,select_result *result);
int mysql_union(THD *thd,LEX *lex,select_result *result);
Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
- Item_result_field ***copy_func, Field **from_field,
+ Item ***copy_func, Field **from_field,
bool group,bool modify_item);
int mysql_create_table(THD *thd,const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
@@ -474,6 +474,7 @@ extern struct st_des_keyschedule des_keyschedule[10];
extern uint des_default_key;
extern pthread_mutex_t LOCK_des_key_file;
bool load_des_key_file(const char *file_name);
+void free_des_key_file();
#endif /* HAVE_OPENSSL */
/* sql_do.cc */
@@ -700,6 +701,7 @@ extern struct rand_struct sql_rand;
extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db;
extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink;
extern SHOW_COMP_OPTION have_query_cache, have_berkeley_db, have_innodb;
+extern SHOW_COMP_OPTION have_crypt;
#ifndef __WIN__
extern pthread_t signal_thread;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ee3eb13d833..18e44eff2a8 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000-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
@@ -79,7 +79,9 @@ extern "C" { // Because of SCO 3.2V4.2
#if defined(OS2)
# include <sys/un.h>
#elif !defined( __WIN__)
+# ifndef __NETWARE__
#include <sys/resource.h>
+# endif /* __NETWARE__ */
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
@@ -117,6 +119,15 @@ int deny_severity = LOG_WARNING;
#include <sys/mman.h>
#endif
+#ifdef __NETWARE__
+#include <nks/vm.h>
+#include <library.h>
+#include <monitor.h>
+
+event_handle_t eh;
+Report_t ref;
+#endif /* __NETWARE__ */
+
#ifdef _AIX41
int initgroups(const char *,unsigned int);
#endif
@@ -240,6 +251,11 @@ SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_YES;
#else
SHOW_COMP_OPTION have_query_cache=SHOW_OPTION_NO;
#endif
+#ifdef HAVE_CRYPT
+SHOW_COMP_OPTION have_crypt=SHOW_OPTION_YES;
+#else
+SHOW_COMP_OPTION have_crypt=SHOW_OPTION_NO;
+#endif
bool opt_large_files= sizeof(my_off_t) > 4;
#if SIZEOF_OFF_T > 4 && defined(BIG_TABLES)
@@ -361,8 +377,8 @@ ulong bytes_sent = 0L, bytes_received = 0L;
bool opt_endinfo,using_udf_functions, locked_in_memory;
bool opt_using_transactions, using_update_log;
-bool volatile abort_loop,select_thread_in_use,grant_option;
-bool volatile ready_to_exit,shutdown_in_progress;
+bool volatile abort_loop, select_thread_in_use, signal_thread_in_use;
+bool volatile ready_to_exit, shutdown_in_progress, grant_option;
ulong refresh_version=1L,flush_version=1L; /* Increments on each reload */
ulong query_id=1L,long_query_count,aborted_threads,
aborted_connects,delayed_insert_timeout,delayed_insert_limit,
@@ -471,6 +487,7 @@ static uint set_maximum_open_files(uint max_file_limit);
#endif
static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
static void clean_up(bool print_message);
+static void clean_up_mutexes(void);
/****************************************************************************
** Code to end mysqld
@@ -498,7 +515,7 @@ static void close_connections(void)
(void) pthread_mutex_unlock(&LOCK_manager);
/* kill connection thread */
-#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
DBUG_PRINT("quit",("waiting for select thread: %lx",select_thread));
(void) pthread_mutex_lock(&LOCK_thread_count);
@@ -640,14 +657,11 @@ static void close_connections(void)
}
(void) pthread_mutex_unlock(&LOCK_thread_count);
- mysql_log.close(1);
- mysql_slow_log.close(1);
- mysql_update_log.close(1);
- mysql_bin_log.close(1);
DBUG_PRINT("quit",("close_connections thread"));
DBUG_VOID_RETURN;
}
+
static void close_server_sock()
{
#ifdef HAVE_CLOSE_SERVER_SOCK
@@ -659,10 +673,10 @@ static void close_server_sock()
ip_sock=INVALID_SOCKET;
DBUG_PRINT("info",("calling shutdown on TCP/IP socket"));
VOID(shutdown(tmp_sock,2));
-#ifdef NOT_USED
+#if defined(__NETWARE__)
/*
- The following code is disabled as it causes MySQL to hang on
- AIX 4.3 during shutdown
+ The following code is disabled for normal systems as it causes MySQL
+ to hang on AIX 4.3 during shutdown
*/
DBUG_PRINT("info",("calling closesocket on TCP/IP socket"));
VOID(closesocket(tmp_sock));
@@ -674,9 +688,9 @@ static void close_server_sock()
unix_sock=INVALID_SOCKET;
DBUG_PRINT("info",("calling shutdown on unix socket"));
VOID(shutdown(tmp_sock,2));
-#ifdef NOT_USED
+#if defined(__NETWARE__)
/*
- The following code is disabled as it may cause MySQL to hang on
+ The following code is disabled for normal systems as it causes MySQL
AIX 4.3 during shutdown (not tested, but likely)
*/
DBUG_PRINT("info",("calling closesocket on unix/IP socket"));
@@ -741,7 +755,7 @@ void kill_mysql(void)
/* Force server down. kill all connections and threads and exit */
-#if defined(OS2)
+#if defined(OS2) || defined(__NETWARE__)
extern "C" void kill_server(int sig_ptr)
#define RETURN_FROM_KILL_SERVER DBUG_RETURN
#elif !defined(__WIN__)
@@ -760,13 +774,16 @@ static void __cdecl kill_server(int sig_ptr)
RETURN_FROM_KILL_SERVER;
kill_in_progress=TRUE;
abort_loop=1; // This should be set
+#ifdef __NETWARE__
+ ActivateScreen(getscreenhandle()); // Show the screen going down
+#endif
signal(sig,SIG_IGN);
if (sig == MYSQL_KILL_SIGNAL || sig == 0)
sql_print_error(ER(ER_NORMAL_SHUTDOWN),my_progname);
else
sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */
-#if defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2)
+#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2))
my_thread_init(); // If this is a new thread
#endif
close_connections();
@@ -774,12 +791,18 @@ static void __cdecl kill_server(int sig_ptr)
unireg_abort(1); /* purecov: inspected */
else
unireg_end();
+
+#ifdef __NETWARE__
+ pthread_join(select_thread, NULL); // wait for main thread
+#else
pthread_exit(0); /* purecov: deadcode */
+#endif /* __NETWARE__ */
+
RETURN_FROM_KILL_SERVER;
}
-#ifdef USE_ONE_SIGNAL_HAND
+#if defined(USE_ONE_SIGNAL_HAND) || (defined(__NETWARE__) && defined(SIGNALS_DONT_BREAK_READ))
extern "C" pthread_handler_decl(kill_server_thread,arg __attribute__((unused)))
{
SHUTDOWN_THD;
@@ -806,7 +829,7 @@ extern "C" sig_handler print_signal_warning(int sig)
#ifdef DONT_REMEMBER_SIGNAL
sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
if (sig == SIGALRM)
alarm(2); /* reschedule alarm */
#endif
@@ -830,11 +853,13 @@ void unireg_end(void)
{
clean_up(1);
my_thread_end();
+#ifndef __NETWARE__
#ifdef SIGNALS_DONT_BREAK_READ
exit(0);
#else
pthread_exit(0); // Exit is in main thread
#endif
+#endif /* __NETWARE__ */
}
@@ -846,6 +871,8 @@ extern "C" void unireg_abort(int exit_code)
clean_up(1); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
my_thread_end();
+ clean_up_mutexes();
+ my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(exit_code); /* purecov: inspected */
}
@@ -855,6 +882,12 @@ void clean_up(bool print_message)
DBUG_PRINT("exit",("clean_up"));
if (cleanup_done++)
return; /* purecov: inspected */
+
+ mysql_log.cleanup();
+ mysql_slow_log.cleanup();
+ mysql_update_log.cleanup();
+ mysql_bin_log.cleanup();
+
if (use_slave_mask)
bitmap_free(&slave_error_mask);
acl_free(1);
@@ -884,6 +917,9 @@ void clean_up(bool print_message)
bitmap_free(&temp_pool);
free_max_user_conn();
end_slave_list();
+#ifdef HAVE_OPENSSL
+ free_des_key_file();
+#endif /* HAVE_OPENSSL */
#ifdef USE_REGEX
regex_end();
#endif
@@ -911,6 +947,35 @@ void clean_up(bool print_message)
} /* clean_up */
+static void clean_up_mutexes()
+{
+ (void) pthread_mutex_destroy(&LOCK_mysql_create_db);
+ (void) pthread_mutex_destroy(&LOCK_Acl);
+ (void) pthread_mutex_destroy(&LOCK_grant);
+ (void) pthread_mutex_destroy(&LOCK_open);
+ (void) pthread_mutex_destroy(&LOCK_thread_count);
+ (void) pthread_mutex_destroy(&LOCK_mapped_file);
+ (void) pthread_mutex_destroy(&LOCK_status);
+ (void) pthread_mutex_destroy(&LOCK_error_log);
+ (void) pthread_mutex_destroy(&LOCK_delayed_insert);
+ (void) pthread_mutex_destroy(&LOCK_delayed_status);
+ (void) pthread_mutex_destroy(&LOCK_delayed_create);
+ (void) pthread_mutex_destroy(&LOCK_manager);
+ (void) pthread_mutex_destroy(&LOCK_crypt);
+ (void) pthread_mutex_destroy(&LOCK_bytes_sent);
+ (void) pthread_mutex_destroy(&LOCK_bytes_received);
+ (void) pthread_mutex_destroy(&LOCK_timezone);
+ (void) pthread_mutex_destroy(&LOCK_user_conn);
+ (void) pthread_mutex_destroy(&LOCK_rpl_status);
+ (void) pthread_mutex_destroy(&LOCK_active_mi);
+ (void) pthread_mutex_destroy(&LOCK_global_system_variables);
+ (void) pthread_cond_destroy(&COND_thread_count);
+ (void) pthread_cond_destroy(&COND_refresh);
+ (void) pthread_cond_destroy(&COND_thread_cache);
+ (void) pthread_cond_destroy(&COND_flush_thread_cache);
+ (void) pthread_cond_destroy(&COND_manager);
+ (void) pthread_cond_destroy(&COND_rpl_status);
+}
/****************************************************************************
** Init IP and UNIX socket
@@ -944,7 +1009,7 @@ static void set_ports()
static void set_user(const char *user)
{
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
struct passwd *ent;
// don't bother if we aren't superuser
@@ -1005,7 +1070,7 @@ static void set_user(const char *user)
static void set_root(const char *path)
{
-#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
if (chroot(path) == -1)
{
sql_perror("chroot");
@@ -1317,6 +1382,89 @@ static void start_signal_handler(void)
{
}
+#elif defined(__NETWARE__)
+
+// down server event callback
+void mysql_down_server_cb(void *, void *)
+{
+ setscreenmode(SCR_AUTOCLOSE_ON_EXIT); // auto close the screen
+ kill_server(0);
+}
+
+// destroy callback resources
+void mysql_cb_destroy(void *)
+{
+ UnRegisterEventNotification(eh); // cleanup down event notification
+ NX_UNWRAP_INTERFACE(ref);
+}
+
+// initialize callbacks
+void mysql_cb_init()
+{
+ // register for down server event
+ void *handle = getnlmhandle();
+ rtag_t rt = AllocateResourceTag(handle, "MySQL Down Server Callback",
+ EventSignature);
+ NX_WRAP_INTERFACE((void *)mysql_down_server_cb, 2, (void **)&ref);
+ eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER,
+ EVENT_PRIORITY_APPLICATION,
+ NULL, ref, NULL);
+ NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up
+}
+
+static void init_signals(void)
+{
+ int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT};
+
+ for (uint i=0 ; i < sizeof(signals)/sizeof(int) ; i++)
+ signal(signals[i], kill_server);
+ mysql_cb_init(); // initialize callbacks
+}
+
+static void start_signal_handler(void)
+{
+ // Save vm id of this process
+ if (!opt_bootstrap)
+ {
+ File pidFile;
+ if ((pidFile = my_create(pidfile_name,0664, O_WRONLY, MYF(MY_WME))) >= 0)
+ {
+ char buff[21];
+ sprintf(buff,"%lu",(ulong) getpid());
+ (void) my_write(pidFile, buff,strlen(buff),MYF(MY_WME));
+ (void) my_close(pidFile,MYF(0));
+ }
+ }
+ // no signal handler
+}
+
+
+/* Warn if the data is on a Traditional volume */
+
+static void check_data_home(const char *path)
+{
+ struct volume_info vol;
+ char buff[PATH_MAX], *pos;
+
+ bzero((char*) &vol, sizeof(vol)); // clear struct
+
+ // find volume name
+ if ((pos= strchr(path, ':')))
+ {
+ uint length= (uint) (pos-path);
+ strmake(buff, path, min(length, sizeof(buff)-1));
+ }
+ else
+ strmov(buff, "SYS"); // assume SYS volume
+
+ netware_vol_info_from_name(&vol, buff); // retrieve information
+ if ((vol.flags & VOL_NSS_PRESENT) == 0)
+ {
+ sql_print_error("Error: %s is not on an NSS volume!", path);
+ unireg_abort(-1);
+ }
+}
+
#elif defined(__EMX__)
static void sig_reload(int signo)
{
@@ -1352,6 +1500,10 @@ static void start_signal_handler(void)
{
}
+static void check_data_home(const char *path)
+{
+}
+
#else /* if ! __WIN__ && ! __EMX__ */
#ifdef HAVE_LINUXTHREADS
@@ -1554,7 +1706,8 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
int sig;
my_thread_init(); // Init new thread
DBUG_ENTER("signal_hand");
- SIGNAL_THD;
+ signal_thread_in_use= 1;
+
/*
Setup alarm handler
The two extra handlers are for slave threads
@@ -1621,6 +1774,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
if (cleanup_done)
{
my_thread_end();
+ signal_thread_in_use= 0;
pthread_exit(0); // Safety
}
switch (sig) {
@@ -1672,6 +1826,10 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
return(0); /* purecov: deadcode */
}
+static void check_data_home(const char *path)
+{
+}
+
#endif /* __WIN__*/
@@ -1844,6 +2002,12 @@ int main(int argc, char **argv)
tzset(); // Set tzname
start_time=time((time_t*) 0);
+
+#ifdef __NETWARE__
+ printf("MySQL Server %s, for %s (%s)\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ fflush(stdout);
+#endif /* __NETWARE__ */
+
#ifdef OS2
{
// fix timezone for daylight saving
@@ -2006,6 +2170,7 @@ int main(int argc, char **argv)
We have enough space for fiddling with the argv, continue
*/
umask(((~my_umask) & 0666));
+ check_data_home(mysql_real_data_home);
if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
{
unireg_abort(1); /* purecov: inspected */
@@ -2054,7 +2219,7 @@ int main(int argc, char **argv)
sql_print_error("Can't init databases");
if (unix_sock != INVALID_SOCKET)
unlink(mysql_unix_port);
- exit(1);
+ unireg_abort(1);
}
ha_key_cache();
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT)
@@ -2091,21 +2256,23 @@ int main(int argc, char **argv)
sql_print_error("Can't create thread-keys");
if (unix_sock != INVALID_SOCKET)
unlink(mysql_unix_port);
- exit(1);
+ unireg_abort(1);
}
start_signal_handler(); // Creates pidfile
if (acl_init((THD*) 0, opt_noacl))
{
abort_loop=1;
select_thread_in_use=0;
- (void) pthread_kill(signal_thread,MYSQL_KILL_SIGNAL);
+#ifndef __NETWARE__
+ (void) pthread_kill(signal_thread, MYSQL_KILL_SIGNAL);
+#endif /* __NETWARE__ */
#ifndef __WIN__
if (!opt_bootstrap)
(void) my_delete(pidfile_name,MYF(MY_WME)); // Not needed anymore
#endif
if (unix_sock != INVALID_SOCKET)
unlink(mysql_unix_port);
- exit(1);
+ unireg_abort(1);
}
if (!opt_noacl)
(void) grant_init((THD*) 0);
@@ -2194,7 +2361,9 @@ The server will not act as a slave.");
sql_print_error("Warning: Can't create thread to manage maintenance");
}
- printf(ER(ER_READY),my_progname,server_version,"");
+ if (unix_sock == INVALID_SOCKET)
+ mysql_unix_port[0]= 0;
+ printf(ER(ER_READY),my_progname,server_version, mysql_unix_port, mysql_port);
fflush(stdout);
#ifdef __NT__
@@ -2277,6 +2446,22 @@ The server will not act as a slave.");
CloseHandle(hEventShutdown);
}
#endif
+#ifndef __NETWARE__
+ {
+ uint i;
+ /*
+ Wait up to 10 seconds for signal thread to die. We use this mainly to
+ avoid getting warnings that my_thread_end has not been called
+ */
+ for (i= 0 ; i < 100 && signal_thread_in_use; i++)
+ {
+ if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL))
+ break;
+ my_sleep(100); // Give it time to die
+ }
+ }
+#endif
+ clean_up_mutexes();
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(0);
return(0); /* purecov: deadcode */
@@ -2552,7 +2737,10 @@ static void create_new_thread(THD *thd)
inline void kill_broken_server()
{
/* hack to get around signals ignored in syscalls for problem OS's */
- if (unix_sock == INVALID_SOCKET ||
+ if (
+#if !defined(__NETWARE__)
+ unix_sock == INVALID_SOCKET ||
+#endif
(!opt_disable_networking && ip_sock == INVALID_SOCKET))
{
select_thread_in_use = 0;
@@ -2566,7 +2754,8 @@ inline void kill_broken_server()
/* Handle new connections and spawn new process to handle them */
-extern "C" pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused)))
+extern "C" pthread_handler_decl(handle_connections_sockets,
+ arg __attribute__((unused)))
{
my_socket sock,new_sock;
uint error_count=0;
@@ -2652,6 +2841,13 @@ extern "C" pthread_handler_decl(handle_connections_sockets,arg __attribute__((un
size_socket length=sizeof(struct sockaddr_in);
new_sock = accept(sock, my_reinterpret_cast(struct sockaddr *) (&cAddr),
&length);
+#ifdef __NETWARE__
+ // TODO: temporary fix, waiting for TCP/IP fix - DEFECT000303149
+ if ((new_sock == INVALID_SOCKET) && (socket_errno == EINVAL))
+ {
+ kill_server(SIGTERM);
+ }
+#endif
if (new_sock != INVALID_SOCKET ||
(socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN))
break;
@@ -2880,7 +3076,7 @@ enum options {
OPT_BDB_HOME, OPT_BDB_LOG,
OPT_BDB_TMP, OPT_BDB_NOSYNC,
OPT_BDB_LOCK, OPT_BDB_SKIP,
- OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
+ OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
OPT_MASTER_HOST, OPT_MASTER_USER,
OPT_MASTER_PASSWORD, OPT_MASTER_PORT,
OPT_MASTER_INFO_FILE, OPT_MASTER_CONNECT_RETRY,
@@ -2964,7 +3160,8 @@ enum options {
OPT_INNODB_FORCE_RECOVERY,
OPT_BDB_CACHE_SIZE,
OPT_BDB_LOG_BUFFER_SIZE,
- OPT_BDB_MAX_LOCK
+ OPT_BDB_MAX_LOCK,
+ OPT_AUTOCLOSE
};
@@ -2974,6 +3171,9 @@ struct my_option my_long_options[] =
{
{"ansi", 'a', "Use ANSI SQL syntax instead of MySQL syntax", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef __NETWARE__
+ {"autoclose", OPT_AUTOCLOSE, "Auto close screen. (NetWare only)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif /* __NETWARE__ */
{"basedir", 'b',
"Path to installation directory. All paths are usually resolved relative to this.",
(gptr*) &mysql_home_ptr, (gptr*) &mysql_home_ptr, 0, GET_STR, REQUIRED_ARG,
@@ -3971,8 +4171,8 @@ static void set_options(void)
global_system_variables.max_join_size= HA_POS_ERROR;
max_system_variables.max_join_size= HA_POS_ERROR;
-#ifdef __WIN__
- /* Allow Win32 users to move MySQL anywhere */
+#if defined(__WIN__) || defined(__NETWARE__)
+ /* Allow Win32 and NetWare users to move MySQL anywhere */
{
char prg_dev[LIBLEN];
my_path(prg_dev,my_progname,"mysql/bin");
@@ -4291,6 +4491,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case (int) OPT_STANDALONE: /* Dummy option for NT */
break;
#endif
+#ifdef __NETWARE__
+ case (int) OPT_AUTOCLOSE:
+ setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
+ break;
+#endif
case (int) OPT_FLUSH:
#ifdef HAVE_ISAM
nisam_flush=1;
@@ -4462,7 +4667,7 @@ static void get_options(int argc,char **argv)
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
-#ifdef HAVE_BROKEN_REALPATH
+#if defined(HAVE_BROKEN_REALPATH)
my_use_symdir=0;
my_disable_symlinks=1;
have_symlink=SHOW_OPTION_NO;
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 471fd62ecb2..cbb30cafdc4 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -75,7 +75,7 @@ static int init_failsafe_rpl_thread(THD* thd)
DBUG_RETURN(-1);
}
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 8e0baa234da..1a9f6626c64 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -416,6 +416,7 @@ struct show_var_st init_vars[]= {
{"ft_max_word_len_for_sort",(char*) &ft_max_word_len_for_sort, SHOW_LONG},
{"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR},
{"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE},
+ {"have_crypt", (char*) &have_crypt, SHOW_HAVE},
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE},
{"have_raid", (char*) &have_raid, SHOW_HAVE},
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 93a1b66816a..a11be9b0e7f 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -77,7 +77,7 @@
"BLOB column '%-.64s' can't be used in key specification with the used table type",
"Too big column length for column '%-.64s' (max = %d). Use BLOB instead",
"Incorrect table definition; There can only be one auto column and it must be defined as a key",
-"%s: ready for connections\n",
+"%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d\n",
"%s: Normal shutdown\n",
"%s: Got signal %d. Aborting!\n",
"%s: Shutdown Complete\n",
diff --git a/sql/slave.cc b/sql/slave.cc
index 839189956a1..164b8ba458f 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -33,8 +33,7 @@ typedef bool (*CHECK_KILLED_FUNC)(THD*,void*);
volatile bool slave_sql_running = 0, slave_io_running = 0;
char* slave_load_tmpdir = 0;
-MASTER_INFO main_mi;
-MASTER_INFO* active_mi;
+MASTER_INFO *active_mi;
volatile int active_mi_in_use = 0;
HASH replicate_do_table, replicate_ignore_table;
DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
@@ -120,18 +119,19 @@ int init_slave()
TODO: re-write this to interate through the list of files
for multi-master
*/
- active_mi = &main_mi;
+ active_mi= new MASTER_INFO;
/*
If master_host is not specified, try to read it from the master_info file.
If master_host is specified, create the master_info file if it doesn't
exists.
*/
- if (init_master_info(active_mi,master_info_file,relay_log_info_file,
+ if (!active_mi ||
+ init_master_info(active_mi,master_info_file,relay_log_info_file,
!master_host))
{
- sql_print_error("Warning: failed to initialized master info");
- DBUG_RETURN(0);
+ sql_print_error("Note: Failed to initialized master info");
+ goto err;
}
/*
@@ -149,9 +149,15 @@ int init_slave()
master_info_file,
relay_log_info_file,
SLAVE_IO | SLAVE_SQL))
+ {
sql_print_error("Warning: Can't create threads to handle slave");
+ goto err;
+ }
}
DBUG_RETURN(0);
+
+err:
+ DBUG_RETURN(1);
}
@@ -755,23 +761,29 @@ static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/)
}
#endif
+
void end_slave()
{
- /*
- TODO: replace the line below with
- list_walk(&master_list, (list_walk_action)end_slave_on_walk,0);
- once multi-master code is ready.
- */
- terminate_slave_threads(active_mi,SLAVE_FORCE_ALL);
- end_master_info(active_mi);
- if (do_table_inited)
- hash_free(&replicate_do_table);
- if (ignore_table_inited)
- hash_free(&replicate_ignore_table);
- if (wild_do_table_inited)
- free_string_array(&replicate_wild_do_table);
- if (wild_ignore_table_inited)
- free_string_array(&replicate_wild_ignore_table);
+ if (active_mi)
+ {
+ /*
+ TODO: replace the line below with
+ list_walk(&master_list, (list_walk_action)end_slave_on_walk,0);
+ once multi-master code is ready.
+ */
+ terminate_slave_threads(active_mi,SLAVE_FORCE_ALL);
+ end_master_info(active_mi);
+ if (do_table_inited)
+ hash_free(&replicate_do_table);
+ if (ignore_table_inited)
+ hash_free(&replicate_ignore_table);
+ if (wild_do_table_inited)
+ free_string_array(&replicate_wild_do_table);
+ if (wild_ignore_table_inited)
+ free_string_array(&replicate_wild_ignore_table);
+ delete active_mi;
+ active_mi= 0;
+ }
}
@@ -1563,6 +1575,42 @@ bool flush_master_info(MASTER_INFO* mi)
DBUG_RETURN(0);
}
+
+st_relay_log_info::st_relay_log_info()
+ :info_fd(-1), cur_log_fd(-1), master_log_pos(0), save_temporary_tables(0),
+ cur_log_old_open_count(0), log_space_total(0),
+ slave_skip_counter(0), abort_pos_wait(0), slave_run_id(0),
+ sql_thd(0), last_slave_errno(0), inited(0), abort_slave(0),
+ slave_running(0), log_pos_current(0), skip_log_purge(0),
+ inside_transaction(0) /* the default is autocommit=1 */
+{
+ relay_log_name[0] = master_log_name[0] = 0;
+ last_slave_error[0]=0;
+
+
+ bzero(&info_file,sizeof(info_file));
+ bzero(&cache_buf, sizeof(cache_buf));
+ pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
+ pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST);
+ pthread_cond_init(&data_cond, NULL);
+ pthread_cond_init(&start_cond, NULL);
+ pthread_cond_init(&stop_cond, NULL);
+ pthread_cond_init(&log_space_cond, NULL);
+}
+
+
+st_relay_log_info::~st_relay_log_info()
+{
+ pthread_mutex_destroy(&run_lock);
+ pthread_mutex_destroy(&data_lock);
+ pthread_mutex_destroy(&log_space_lock);
+ pthread_cond_destroy(&data_cond);
+ pthread_cond_destroy(&start_cond);
+ pthread_cond_destroy(&stop_cond);
+ pthread_cond_destroy(&log_space_cond);
+}
+
/*
Waits until the SQL thread reaches (has executed up to) the
log/position or timed out.
@@ -1755,7 +1803,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
DBUG_RETURN(-1);
}
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
@@ -2281,14 +2329,16 @@ err:
THD_CHECK_SENTRY(thd);
delete thd;
pthread_mutex_unlock(&LOCK_thread_count);
- my_thread_end(); // clean-up before broadcast
pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done
pthread_mutex_unlock(&mi->run_lock);
#ifndef DBUG_OFF
if (abort_slave_event_count && !events_till_abort)
goto slave_begin;
#endif
+ my_thread_end();
+#ifndef __NETWARE__
pthread_exit(0);
+#endif /* __NETWARE__ */
DBUG_RETURN(0); // Can't return anything here
}
@@ -2420,7 +2470,6 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
THD_CHECK_SENTRY(thd);
delete thd;
pthread_mutex_unlock(&LOCK_thread_count);
- my_thread_end(); // clean-up before broadcasting termination
pthread_cond_broadcast(&rli->stop_cond);
// tell the world we are done
pthread_mutex_unlock(&rli->run_lock);
@@ -2428,10 +2477,14 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \
if (abort_slave_event_count && !rli->events_till_abort)
goto slave_begin;
#endif
+ my_thread_end(); // clean-up before broadcasting termination
+#ifndef __NETWARE__
pthread_exit(0);
+#endif /* __NETWARE__ */
DBUG_RETURN(0); // Can't return anything here
}
+
static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
{
int error = 1;
@@ -2464,9 +2517,10 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
goto err;
}
- /* this dummy block is so we could instantiate Append_block_log_event
- once and then modify it slightly instead of doing it multiple times
- in the loop
+ /*
+ This dummy block is so we could instantiate Append_block_log_event
+ once and then modify it slightly instead of doing it multiple times
+ in the loop
*/
{
Append_block_log_event aev(thd,0,0,0);
diff --git a/sql/slave.h b/sql/slave.h
index 72ddcd8b471..ea7e2b4ef16 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -103,7 +103,7 @@ typedef struct st_relay_log_info
created temporary tables. Modified only on init/end and by the SQL
thread, read only by SQL thread.
*/
- TABLE* save_temporary_tables;
+ TABLE *save_temporary_tables;
/*
standard lock acquistion order to avoid deadlocks:
@@ -171,33 +171,8 @@ typedef struct st_relay_log_info
bool skip_log_purge;
bool inside_transaction;
- st_relay_log_info()
- :info_fd(-1),cur_log_fd(-1), cur_log_old_open_count(0), abort_pos_wait(0),
- slave_run_id(0), inited(0), abort_slave(0), slave_running(0),
- log_pos_current(0), skip_log_purge(0),
- inside_transaction(0) /* the default is autocommit=1 */
- {
- relay_log_name[0] = master_log_name[0] = 0;
- bzero(&info_file,sizeof(info_file));
- bzero(&cache_buf, sizeof(cache_buf));
- pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
- pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
- pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST);
- pthread_cond_init(&data_cond, NULL);
- pthread_cond_init(&start_cond, NULL);
- pthread_cond_init(&stop_cond, NULL);
- pthread_cond_init(&log_space_cond, NULL);
- }
- ~st_relay_log_info()
- {
- pthread_mutex_destroy(&run_lock);
- pthread_mutex_destroy(&data_lock);
- pthread_mutex_destroy(&log_space_lock);
- pthread_cond_destroy(&data_cond);
- pthread_cond_destroy(&start_cond);
- pthread_cond_destroy(&stop_cond);
- pthread_cond_destroy(&log_space_cond);
- }
+ st_relay_log_info();
+ ~st_relay_log_info();
inline void inc_pending(ulonglong val)
{
pending += val;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 54c3e40244a..b53c05c0357 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -549,7 +549,7 @@ void close_temporary_tables(THD *thd)
query_buf_size= 50; // Enough for DROP ... TABLE
for (table=thd->temporary_tables ; table ; table=table->next)
- query_buf_size += table->key_length;
+ query_buf_size+= table->key_length+1;
if ((query = alloc_root(&thd->mem_root, query_buf_size)))
end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE ");
diff --git a/sql/sql_class.h b/sql/sql_class.h
index af80c3e31ac..802052d553a 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -111,6 +111,7 @@ public:
void init(enum_log_type log_type_arg,
enum cache_type io_cache_type_arg = WRITE_CACHE,
bool no_auto_events_arg = 0);
+ void cleanup();
bool open(const char *log_name,enum_log_type log_type,
const char *new_name, const char *index_file_name_arg,
enum cache_type io_cache_type_arg,
@@ -320,7 +321,8 @@ struct system_variables
a thread/connection descriptor
*/
-class THD :public ilink {
+class THD :public ilink
+{
public:
NET net; // client connection descriptor
LEX lex; // parse tree descriptor
@@ -478,7 +480,7 @@ public:
active_vio = 0;
pthread_mutex_unlock(&LOCK_delete);
}
- void THD::close_active_vio();
+ void close_active_vio();
#endif
void awake(bool prepare_to_die);
inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex,
@@ -796,12 +798,7 @@ public:
class multi_delete : public select_result {
TABLE_LIST *delete_tables, *table_being_deleted;
-#ifdef SINISAS_STRIP
- IO_CACHE **tempfiles;
- byte *memory_lane;
-#else
Unique **tempfiles;
-#endif
THD *thd;
ha_rows deleted;
uint num_of_tables;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 56a89e0bd1c..23563239558 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -939,7 +939,7 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg)
strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES));
goto end;
}
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0a5ebc585b2..9946c9961b1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -652,7 +652,7 @@ pthread_handler_decl(handle_one_connection,arg)
#if defined(__WIN__)
init_signals(); // IRENA; testing ?
-#elif !defined(OS2)
+#elif !defined(OS2) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
@@ -682,7 +682,9 @@ pthread_handler_decl(handle_one_connection,arg)
statistic_increment(aborted_connects,&LOCK_status);
goto end_thread;
}
-
+#ifdef __NETWARE__
+ netware_reg_user(thd->ip, thd->user, "MySQL");
+#endif
if (thd->variables.max_join_size == HA_POS_ERROR)
thd->options |= OPTION_BIG_SELECTS;
if (thd->client_capabilities & CLIENT_COMPRESS)
@@ -751,12 +753,10 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg)
pthread_detach_this_thread();
thd->thread_stack= (char*) &thd;
-#if !defined(__WIN__) && !defined(OS2)
+#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
-
-
#endif
if (thd->variables.max_join_size == HA_POS_ERROR)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index e811c55ed1b..6996bba8798 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -506,7 +506,16 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
error= -1; /* if goto err */
/* Optimize distinct away if possible */
- order=remove_const(&join,order,conds,&simple_order);
+ {
+ ORDER *org_order= order;
+ order=remove_const(&join,order,conds,&simple_order);
+ /*
+ If we are using ORDER BY NULL or ORDER BY const_expression,
+ return result in any order (even if we are using a GROUP BY)
+ */
+ if (!order && org_order)
+ skip_sort_order= 1;
+ }
if (group || join.tmp_table_param.sum_func_count)
{
if (! hidden_group_fields)
@@ -776,7 +785,7 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
procedure->update_refs();
if (tmp_table->group)
{ // Already grouped
- if (!order && !no_order)
+ if (!order && !no_order && !skip_sort_order)
order=group; /* order by group */
group=0;
}
@@ -3529,7 +3538,7 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
*/
Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
- Item_result_field ***copy_func, Field **from_field,
+ Item ***copy_func, Field **from_field,
bool group, bool modify_item)
{
switch (type) {
@@ -3590,12 +3599,12 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
}
return new_field;
}
- case Item::PROC_ITEM:
case Item::FUNC_ITEM:
case Item::COND_ITEM:
case Item::FIELD_AVG_ITEM:
case Item::FIELD_STD_ITEM:
/* The following can only happen with 'CREATE TABLE ... SELECT' */
+ case Item::PROC_ITEM:
case Item::INT_ITEM:
case Item::REAL_ITEM:
case Item::STRING_ITEM:
@@ -3624,10 +3633,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
item->name,table,item->binary);
break;
}
- if (copy_func)
- *((*copy_func)++) = (Item_result_field*) item; // Save for copy_funcs
+ if (copy_func && item->is_result_field())
+ *((*copy_func)++) = item; // Save for copy_funcs
if (modify_item)
- ((Item_result_field*) item)->result_field=new_field;
+ item->set_result_field(new_field);
return new_field;
}
default: // Dosen't have to be stored
@@ -3661,7 +3670,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
Copy_field *copy=0;
KEY *keyinfo;
KEY_PART_INFO *key_part_info;
- Item_result_field **copy_func;
+ Item **copy_func;
MI_COLUMNDEF *recinfo;
uint temp_pool_slot=MY_BIT_NONE;
@@ -3725,7 +3734,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
my_free((gptr) table,MYF(0)); /* purecov: inspected */
DBUG_RETURN(NULL); /* purecov: inspected */
}
- param->funcs=copy_func;
+ param->items_to_copy= copy_func;
strmov(tmpname,path);
/* make table according to fields */
@@ -5257,7 +5266,7 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (!end_of_records)
{
copy_fields(&join->tmp_table_param);
- copy_funcs(join->tmp_table_param.funcs);
+ copy_funcs(join->tmp_table_param.items_to_copy);
#ifdef TO_BE_DELETED
if (!table->uniques) // If not unique handling
@@ -5357,7 +5366,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
memcpy(table->record[0]+key_part->offset, group->buff, key_part->length);
init_tmptable_sum_functions(join->sum_funcs);
- copy_funcs(join->tmp_table_param.funcs);
+ copy_funcs(join->tmp_table_param.items_to_copy);
if ((error=table->file->write_row(table->record[0])))
{
if (create_myisam_from_heap(table, &join->tmp_table_param, error, 0))
@@ -5390,7 +5399,7 @@ end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
init_tmptable_sum_functions(join->sum_funcs);
copy_fields(&join->tmp_table_param); // Groups are copied twice.
- copy_funcs(join->tmp_table_param.funcs);
+ copy_funcs(join->tmp_table_param.items_to_copy);
if (!(error=table->file->write_row(table->record[0])))
join->send_records++; // New group
@@ -5475,7 +5484,7 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
if (idx < (int) join->send_group_parts)
{
copy_fields(&join->tmp_table_param);
- copy_funcs(join->tmp_table_param.funcs);
+ copy_funcs(join->tmp_table_param.items_to_copy);
init_sum_functions(join->sum_funcs);
if (join->procedure)
join->procedure->add();
@@ -7144,7 +7153,7 @@ copy_sum_funcs(Item_sum **func_ptr)
{
Item_sum *func;
for (; (func = *func_ptr) ; func_ptr++)
- (void) func->save_in_field(func->result_field, 1);
+ (void) func->save_in_result_field(1);
return;
}
@@ -7171,12 +7180,11 @@ update_sum_func(Item_sum **func_ptr)
/* Copy result of functions to record in tmp_table */
void
-copy_funcs(Item_result_field **func_ptr)
+copy_funcs(Item **func_ptr)
{
- Item_result_field *func;
+ Item *func;
for (; (func = *func_ptr) ; func_ptr++)
- (void) func->save_in_field(func->result_field, 1);
- return;
+ func->save_in_result_field(1);
}
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 40eb4d8ef51..332778aafe6 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -122,7 +122,7 @@ class TMP_TABLE_PARAM :public Sql_alloc
List_iterator_fast<Item> copy_funcs_it;
Copy_field *copy_field, *copy_field_end;
byte *group_buff;
- Item_result_field **funcs;
+ Item **items_to_copy; /* Fields in tmp table */
MI_COLUMNDEF *recinfo,*start_recinfo;
KEY *keyinfo;
ha_rows end_write_records;
@@ -194,7 +194,7 @@ void count_field_types(TMP_TABLE_PARAM *param, List<Item> &fields,
bool reset_with_sum_func);
bool setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,List<Item> &fields);
void copy_fields(TMP_TABLE_PARAM *param);
-void copy_funcs(Item_result_field **func_ptr);
+void copy_funcs(Item **func_ptr);
bool create_myisam_from_heap(TABLE *table, TMP_TABLE_PARAM *param, int error,
bool ignore_last_dupp_error);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a763d6b6b91..4c0ab15edf7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -800,7 +800,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
field=item->tmp_table_field(&tmp_table);
else
field=create_tmp_field(thd, &tmp_table, item, item->type(),
- (Item_result_field***) 0, &tmp_field,0,0);
+ (Item ***) 0, &tmp_field,0,0);
if (!field ||
!(cr_field=new create_field(field,(item->type() == Item::FIELD_ITEM ?
((Item_field *)item)->field :
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 937d1e52656..8ac313e1127 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -229,6 +229,11 @@ void udf_free()
}
hash_free(&udf_hash);
free_root(&mem,MYF(0));
+ if (initialized)
+ {
+ initialized= 0;
+ pthread_mutex_destroy(&THR_LOCK_udf);
+ }
DBUG_VOID_RETURN;
}
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index acce201bfba..84bae5fa0c7 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -22,9 +22,6 @@
#include "mysql.h"
#include "errmsg.h"
#include <my_dir.h>
-#ifndef __GNU_LIBRARY__
-#define __GNU_LIBRARY__ // Skip warnings in getopt.h
-#endif
#include <my_getopt.h>
#include <signal.h>
#include <violite.h>
@@ -50,95 +47,100 @@ print_usage()
printf("viossl-test server-key server-cert client-key client-cert [CAfile] [CApath]\n");
}
+
int
-main( int argc,
- char** argv)
+main(int argc, char** argv)
{
- char* server_key = 0, *server_cert = 0;
- char* client_key = 0, *client_cert = 0;
- char* ca_file = 0, *ca_path = 0;
- char* cipher=0;
- int child_pid,sv[2];
- my_bool unused;
- struct st_VioSSLAcceptorFd* ssl_acceptor=0;
- struct st_VioSSLConnectorFd* ssl_connector=0;
- Vio* client_vio=0, *server_vio=0;
- MY_INIT(argv[0]);
- DBUG_PROCESS(argv[0]);
- DBUG_PUSH(default_dbug_option);
-
- if (argc<5)
- {
- print_usage();
- return 1;
- }
-
- server_key = argv[1];
- server_cert = argv[2];
- client_key = argv[3];
- client_cert = argv[4];
- if (argc>5)
- ca_file = argv[5];
- if (argc>6)
- ca_path = argv[6];
- printf("Server key/cert : %s/%s\n", server_key, server_cert);
- printf("Client key/cert : %s/%s\n", client_key, client_cert);
- if (ca_file!=0)
- printf("CAfile : %s\n", ca_file);
- if (ca_path!=0)
- printf("CApath : %s\n", ca_path);
-
-
- if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1)
- fatal_error("socketpair");
-
- ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file, ca_path, cipher);
- ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, ca_path, cipher);
-
- client_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
- client_vio->sd = sv[0];
- client_vio->vioblocking(client_vio, 0, &unused);
- sslconnect(ssl_connector,client_vio,60L);
- server_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
- server_vio->sd = sv[1];
- server_vio->vioblocking(client_vio, 0, &unused);
- sslaccept(ssl_acceptor,server_vio,60L);
-
- printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
-
- child_pid = fork();
- if (child_pid==-1) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("fork");
- }
- if (child_pid==0) {
- //child, therefore, client
- char xbuf[100];
- int r = client_vio->read(client_vio,xbuf, sizeof(xbuf));
- if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("client:SSL_read");
- }
- xbuf[r] = 0;
- printf("client:got %s\n", xbuf);
- my_free((gptr)client_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- } else {
- const char* s = "Huhuhuh";
- int r = server_vio->write(server_vio,(gptr)s, strlen(s));
- if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("server:SSL_write");
- }
- my_free((gptr)server_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- }
- return 0;
+ char* server_key = 0, *server_cert = 0;
+ char* client_key = 0, *client_cert = 0;
+ char* ca_file = 0, *ca_path = 0;
+ char* cipher=0;
+ int child_pid,sv[2];
+ my_bool unused;
+ struct st_VioSSLAcceptorFd* ssl_acceptor=0;
+ struct st_VioSSLConnectorFd* ssl_connector=0;
+ Vio* client_vio=0, *server_vio=0;
+ MY_INIT(argv[0]);
+ DBUG_PROCESS(argv[0]);
+ DBUG_PUSH(default_dbug_option);
+
+ if (argc<5)
+ {
+ print_usage();
+ return 1;
+ }
+
+ server_key = argv[1];
+ server_cert = argv[2];
+ client_key = argv[3];
+ client_cert = argv[4];
+ if (argc>5)
+ ca_file = argv[5];
+ if (argc>6)
+ ca_path = argv[6];
+ printf("Server key/cert : %s/%s\n", server_key, server_cert);
+ printf("Client key/cert : %s/%s\n", client_key, client_cert);
+ if (ca_file!=0)
+ printf("CAfile : %s\n", ca_file);
+ if (ca_path!=0)
+ printf("CApath : %s\n", ca_path);
+
+
+ if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1)
+ fatal_error("socketpair");
+
+ ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file,
+ ca_path, cipher);
+ ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file,
+ ca_path, cipher);
+
+ client_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
+ client_vio->sd = sv[0];
+ client_vio->vioblocking(client_vio, 0, &unused);
+ sslconnect(ssl_connector,client_vio,60L);
+ server_vio = (struct st_vio*)my_malloc(sizeof(struct st_vio),MYF(0));
+ server_vio->sd = sv[1];
+ server_vio->vioblocking(client_vio, 0, &unused);
+ sslaccept(ssl_acceptor,server_vio,60L);
+
+ printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
+
+ child_pid = fork();
+ if (child_pid==-1) {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("fork");
+ }
+ if (child_pid==0)
+ {
+ /* child, therefore, client */
+ char xbuf[100];
+ int r = client_vio->read(client_vio,xbuf, sizeof(xbuf));
+ if (r<=0) {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("client:SSL_read");
+ }
+ xbuf[r] = 0;
+ printf("client:got %s\n", xbuf);
+ my_free((gptr)client_vio,MYF(0));
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ }
+ else
+ {
+ const char* s = "Huhuhuh";
+ int r = server_vio->write(server_vio,(gptr)s, strlen(s));
+ if (r<=0) {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("server:SSL_write");
+ }
+ my_free((gptr)server_vio,MYF(0));
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ }
+ return 0;
}
#else /* HAVE_OPENSSL */
diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c
index 84853e45485..231ce056d8c 100644
--- a/vio/test-sslclient.c
+++ b/vio/test-sslclient.c
@@ -22,9 +22,6 @@
#include "mysql.h"
#include "errmsg.h"
#include <my_dir.h>
-#ifndef __GNU_LIBRARY__
-#define __GNU_LIBRARY__ // Skip warnings in getopt.h
-#endif
#include <my_getopt.h>
#include <signal.h>
#include <violite.h>
diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c
index f0116a2817d..71b194838c7 100644
--- a/vio/test-sslserver.c
+++ b/vio/test-sslserver.c
@@ -22,9 +22,6 @@
#include "mysql.h"
#include "errmsg.h"
#include <my_dir.h>
-#ifndef __GNU_LIBRARY__
-#define __GNU_LIBRARY__ // Skip warnings in getopt.h
-#endif
#include <my_getopt.h>
#include <signal.h>
#include <violite.h>
diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c
index 1a766a3fc97..b4a191a1e2f 100644
--- a/vio/viotest-ssl.c
+++ b/vio/viotest-ssl.c
@@ -22,11 +22,7 @@
#include "mysql.h"
#include "errmsg.h"
#include <my_dir.h>
-#ifndef __GNU_LIBRARY__
-#define __GNU_LIBRARY__ // Skip warnings in getopt.h
-#endif
#include <my_getopt.h>
-//#include "my_readline.h"
#include <signal.h>
#include <violite.h>
@@ -38,115 +34,115 @@ const char *default_dbug_option="d:t:O,/tmp/viotest-ssl.trace";
#endif
void
-fatal_error( const char* r)
+fatal_error(const char *r)
{
- perror(r);
- exit(0);
+ perror(r);
+ exit(0);
}
void
print_usage()
{
- printf("viossl-test: testing SSL virtual IO. Usage:\n");
- printf("viossl-test server-key server-cert client-key client-cert [CAfile] [CApath]\n");
+ printf("viossl-test: testing SSL virtual IO. Usage:\n");
+ printf("viossl-test server-key server-cert client-key client-cert [CAfile] [CApath]\n");
}
-int
-main( int argc,
- char** argv)
+
+int main(int argc, char **argv)
{
- char* server_key = 0;
- char* server_cert = 0;
- char* client_key = 0;
- char* client_cert = 0;
- char* ca_file = 0;
- char* ca_path = 0;
- int child_pid,sv[2];
- struct st_VioSSLAcceptorFd* ssl_acceptor=0;
- struct st_VioSSLConnectorFd* ssl_connector=0;
- Vio* client_vio=0;
- Vio* server_vio=0;
- MY_INIT(argv[0]);
-// DBUG_ENTER("main");
- DBUG_PROCESS(argv[0]);
- DBUG_PUSH(default_dbug_option);
-
-
-
- if (argc<5)
- {
- print_usage();
- return 1;
- }
-
- server_key = argv[1];
- server_cert = argv[2];
- client_key = argv[3];
- client_cert = argv[4];
- if (argc>5)
- ca_file = argv[5];
- if (argc>6)
- ca_path = argv[6];
- printf("Server key/cert : %s/%s\n", server_key, server_cert);
- printf("Client key/cert : %s/%s\n", client_key, client_cert);
- if (ca_file!=0)
- printf("CAfile : %s\n", ca_file);
- if (ca_path!=0)
- printf("CApath : %s\n", ca_path);
-
-
- if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1)
- fatal_error("socketpair");
-
- ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file, ca_path);
- ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file, ca_path);
-
- client_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
- client_vio->sd = sv[0];
- sslconnect(ssl_connector,client_vio);
- server_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
- server_vio->sd = sv[1];
- sslaccept(ssl_acceptor,server_vio);
-
- printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
-
- child_pid = fork();
- if (child_pid==-1) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("fork");
- }
- if (child_pid==0) {
- //child, therefore, client
- char xbuf[100];
- int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf));
- if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("client:SSL_read");
- }
-// printf("*** client cipher %s\n",client_vio->cipher_description());
- xbuf[r] = 0;
- printf("client:got %s\n", xbuf);
- my_free((gptr)client_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- sleep(1);
- } else {
- const char* s = "Huhuhuh";
- int r = vio_ssl_write(server_vio,(gptr)s, strlen(s));
- if (r<=0) {
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- fatal_error("server:SSL_write");
- }
-// printf("*** server cipher %s\n",server_vio->cipher_description());
- my_free((gptr)server_vio,MYF(0));
- my_free((gptr)ssl_acceptor,MYF(0));
- my_free((gptr)ssl_connector,MYF(0));
- sleep(1);
- }
- return 0;
+ char* server_key = 0;
+ char* server_cert = 0;
+ char* client_key = 0;
+ char* client_cert = 0;
+ char* ca_file = 0;
+ char* ca_path = 0;
+ int child_pid,sv[2];
+ struct st_VioSSLAcceptorFd* ssl_acceptor=0;
+ struct st_VioSSLConnectorFd* ssl_connector=0;
+ Vio* client_vio=0;
+ Vio* server_vio=0;
+ MY_INIT(argv[0]);
+ DBUG_PROCESS(argv[0]);
+ DBUG_PUSH(default_dbug_option);
+
+ if (argc<5)
+ {
+ print_usage();
+ return 1;
+ }
+
+ server_key = argv[1];
+ server_cert = argv[2];
+ client_key = argv[3];
+ client_cert = argv[4];
+ if (argc>5)
+ ca_file = argv[5];
+ if (argc>6)
+ ca_path = argv[6];
+ printf("Server key/cert : %s/%s\n", server_key, server_cert);
+ printf("Client key/cert : %s/%s\n", client_key, client_cert);
+ if (ca_file!=0)
+ printf("CAfile : %s\n", ca_file);
+ if (ca_path!=0)
+ printf("CApath : %s\n", ca_path);
+
+
+ if (socketpair(PF_UNIX, SOCK_STREAM, IPPROTO_IP, sv)==-1)
+ fatal_error("socketpair");
+
+ ssl_acceptor = new_VioSSLAcceptorFd(server_key, server_cert, ca_file,
+ ca_path);
+ ssl_connector = new_VioSSLConnectorFd(client_key, client_cert, ca_file,
+ ca_path);
+
+ client_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
+ client_vio->sd = sv[0];
+ sslconnect(ssl_connector,client_vio);
+ server_vio = (Vio*)my_malloc(sizeof(struct st_vio),MYF(0));
+ server_vio->sd = sv[1];
+ sslaccept(ssl_acceptor,server_vio);
+
+ printf("Socketpair: %d , %d\n", client_vio->sd, server_vio->sd);
+
+ child_pid = fork();
+ if (child_pid==-1)
+ {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("fork");
+ }
+ if (child_pid==0)
+ {
+ /* child, therefore, client */
+ char xbuf[100];
+ int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf));
+ if (r<=0) {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("client:SSL_read");
+ }
+ xbuf[r] = 0;
+ printf("client:got %s\n", xbuf);
+ my_free((gptr)client_vio,MYF(0));
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ sleep(1);
+ }
+ else
+ {
+ const char* s = "Huhuhuh";
+ int r = vio_ssl_write(server_vio,(gptr)s, strlen(s));
+ if (r<=0) {
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ fatal_error("server:SSL_write");
+ }
+ my_free((gptr)server_vio,MYF(0));
+ my_free((gptr)ssl_acceptor,MYF(0));
+ my_free((gptr)ssl_connector,MYF(0));
+ sleep(1);
+ }
+ return 0;
}
#else /* HAVE_OPENSSL */