summaryrefslogtreecommitdiff
path: root/libmysql
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 /libmysql
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
Diffstat (limited to 'libmysql')
-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
4 files changed, 50 insertions, 14 deletions
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