summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/event_executor.cc2
-rw-r--r--sql/hostname.cc2
-rw-r--r--sql/log.cc4
-rw-r--r--sql/log_event.h4
-rw-r--r--sql/my_lock.c2
-rw-r--r--sql/mysql_priv.h6
-rw-r--r--sql/mysqld.cc114
-rw-r--r--sql/net_serv.cc10
-rw-r--r--sql/repl_failsafe.cc2
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_base.cc4
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_load.cc4
-rw-r--r--sql/sql_parse.cc12
-rw-r--r--sql/sql_table.cc12
15 files changed, 33 insertions, 151 deletions
diff --git a/sql/event_executor.cc b/sql/event_executor.cc
index 498760bb6fd..21464dd777b 100644
--- a/sql/event_executor.cc
+++ b/sql/event_executor.cc
@@ -291,7 +291,7 @@ init_event_thread(THD* thd)
DBUG_RETURN(-1);
}
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !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/hostname.cc b/sql/hostname.cc
index c5c337080cf..52c4107372f 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -26,7 +26,7 @@
#ifdef __cplusplus
extern "C" { // Because of SCO 3.2V4.2
#endif
-#if !defined( __WIN__) && !defined(OS2)
+#if !defined( __WIN__)
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/sql/log.cc b/sql/log.cc
index 5c67443d238..3f6e3108a0b 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -18,10 +18,6 @@
/* logging of commands */
/* TODO: Abort logging when we get an error in reading or writing log files */
-#ifdef __EMX__
-#include <io.h>
-#endif
-
#include "mysql_priv.h"
#include "sql_repl.h"
#include "rpl_filter.h"
diff --git a/sql/log_event.h b/sql/log_event.h
index d6ce354fbdf..b24686514e3 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -18,10 +18,6 @@
#ifndef _log_event_h
#define _log_event_h
-#ifdef __EMX__
-#undef write // remove pthread.h macro definition, conflict with write() class member
-#endif
-
#if defined(USE_PRAGMA_INTERFACE) && !defined(MYSQL_CLIENT)
#pragma interface /* gcc class implementation */
#endif
diff --git a/sql/my_lock.c b/sql/my_lock.c
index 7f47256703a..69884df22f8 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 */
-#if defined(__EMX__) || defined(__NETWARE__)
+#if defined(__NETWARE__)
#include "../mysys/my_lock.c"
#else
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index ac7957d41f1..c471b11fee2 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -36,10 +36,6 @@
#include "sql_bitmap.h"
#include "sql_array.h"
-#ifdef __EMX__
-#undef write /* remove pthread.h macro definition for EMX */
-#endif
-
/* TODO convert all these three maps to Bitmap classes */
typedef ulonglong table_map; /* Used for table bits in join */
#if MAX_INDEXES <= 64
@@ -206,7 +202,7 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define IF_NETWARE(A,B) (B)
#endif
-#if defined(__WIN__) || defined(OS2)
+#if defined(__WIN__)
#define IF_WIN(A,B) (A)
#undef FLUSH_TIME
#define FLUSH_TIME 1800 /* Flush every half hour */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 71067630535..33c16eb245a 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -95,9 +95,7 @@ extern "C" { // Because of SCO 3.2V4.2
#endif
#include <my_net.h>
-#if defined(OS2)
-# include <sys/un.h>
-#elif !defined(__WIN__)
+#if !defined(__WIN__)
# ifndef __NETWARE__
#include <sys/resource.h>
# endif /* __NETWARE__ */
@@ -648,10 +646,6 @@ static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
#endif
-#ifdef OS2
-pthread_cond_t eventShutdown;
-#endif
-
#ifndef EMBEDDED_LIBRARY
bool mysqld_embedded=0;
#else
@@ -751,7 +745,7 @@ static void close_connections(void)
(void) pthread_mutex_unlock(&LOCK_manager);
/* kill connection thread */
-#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
DBUG_PRINT("quit",("waiting for select thread: 0x%lx",select_thread));
(void) pthread_mutex_lock(&LOCK_thread_count);
@@ -980,8 +974,6 @@ void kill_mysql(void)
*/
}
#endif
-#elif defined(OS2)
- pthread_cond_signal(&eventShutdown); // post semaphore
#elif defined(HAVE_PTHREAD_KILL)
if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL))
{
@@ -1007,7 +999,7 @@ void kill_mysql(void)
/* Force server down. kill all connections and threads and exit */
-#if defined(OS2) || defined(__NETWARE__)
+#if defined(__NETWARE__)
extern "C" void kill_server(int sig_ptr)
#define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN
#elif !defined(__WIN__)
@@ -1044,7 +1036,7 @@ static void __cdecl kill_server(int sig_ptr)
}
#endif
-#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__) && !defined(OS2))
+#if defined(__NETWARE__) || (defined(USE_ONE_SIGNAL_HAND) && !defined(__WIN__))
my_thread_init(); // If this is a new thread
#endif
close_connections();
@@ -1082,7 +1074,7 @@ extern "C" sig_handler print_signal_warning(int sig)
#ifdef DONT_REMEMBER_SIGNAL
my_sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
if (sig == SIGALRM)
alarm(2); /* reschedule alarm */
#endif
@@ -1336,7 +1328,7 @@ static void set_ports()
static struct passwd *check_user(const char *user)
{
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
struct passwd *user_info;
uid_t user_id= geteuid();
@@ -1390,7 +1382,7 @@ err:
static void set_user(const char *user, struct passwd *user_info)
{
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
DBUG_ASSERT(user_info != 0);
#ifdef HAVE_INITGROUPS
/*
@@ -1419,7 +1411,7 @@ static void set_user(const char *user, struct passwd *user_info)
static void set_effective_user(struct passwd *user_info)
{
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
DBUG_ASSERT(user_info != 0);
if (setregid((gid_t)-1, user_info->pw_gid) == -1)
{
@@ -1439,7 +1431,7 @@ static void set_effective_user(struct passwd *user_info)
static void set_root(const char *path)
{
-#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
if (chroot(path) == -1)
{
sql_perror("chroot");
@@ -1786,7 +1778,7 @@ extern "C" sig_handler abort_thread(int sig __attribute__((unused)))
the signal thread is ready before continuing
******************************************************************************/
-#if defined(__WIN__) || defined(OS2)
+#if defined(__WIN__)
static void init_signals(void)
{
int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT } ;
@@ -2046,44 +2038,7 @@ static void check_data_home(const char *path)
{
}
-#elif defined(__EMX__)
-static void sig_reload(int signo)
-{
- // Flush everything
- bool not_used;
- reload_acl_and_cache((THD*) 0,REFRESH_LOG, (TABLE_LIST*) 0, &not_used);
- signal(signo, SIG_ACK);
-}
-
-static void sig_kill(int signo)
-{
- if (!kill_in_progress)
- {
- abort_loop=1; // mark abort for threads
- kill_server((void*) signo);
- }
- signal(signo, SIG_ACK);
-}
-
-static void init_signals(void)
-{
- signal(SIGQUIT, sig_kill);
- signal(SIGKILL, sig_kill);
- signal(SIGTERM, sig_kill);
- signal(SIGINT, sig_kill);
- signal(SIGHUP, sig_reload); // Flush everything
- signal(SIGALRM, SIG_IGN);
- signal(SIGBREAK,SIG_IGN);
- signal_thread = pthread_self();
-}
-
-static void start_signal_handler(void)
-{}
-
-static void check_data_home(const char *path)
-{}
-
-#else /* if ! __WIN__ && ! __EMX__ */
+#else /* if ! __WIN__ */
#ifdef HAVE_LINUXTHREADS
#define UNSAFE_DEFAULT_LINUX_THREADS 200
@@ -2556,33 +2511,6 @@ int STDCALL handle_kill(ulong ctrl_type)
}
#endif
-
-#ifdef OS2
-pthread_handler_t handle_shutdown(void *arg)
-{
- my_thread_init();
-
- // wait semaphore
- pthread_cond_wait(&eventShutdown, NULL);
-
- // close semaphore and kill server
- pthread_cond_destroy(&eventShutdown);
-
- /*
- Exit main loop on main thread, so kill will be done from
- main thread (this is thread 2)
- */
- abort_loop = 1;
-
- // unblock select()
- so_cancel(ip_sock);
- so_cancel(unix_sock);
-
- return 0;
-}
-#endif
-
-
static const char *load_default_groups[]= {
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
"mysql_cluster",
@@ -2650,14 +2578,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
return 1;
mysql_init_variables();
-#ifdef OS2
- {
- // fix timezone for daylight saving
- struct tm *ts = localtime(&start_time);
- if (ts->tm_isdst > 0)
- _timezone -= 3600;
- }
-#endif
#ifdef HAVE_TZNAME
{
struct tm tm_tmp;
@@ -3360,12 +3280,6 @@ static void create_shutdown_thread()
// On "Stop Service" we have to do regular shutdown
Service.SetShutdownEvent(hEventShutdown);
#endif
-#ifdef OS2
- pthread_cond_init(&eventShutdown, NULL);
- pthread_t hThread;
- if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0))
- sql_print_warning("Can't create thread to handle shutdown requests");
-#endif
#endif // EMBEDDED_LIBRARY
}
@@ -4292,10 +4206,6 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused)))
create_new_thread(thd);
}
-#ifdef OS2
- // kill server must be invoked from thread 1!
- kill_server(MYSQL_KILL_SIGNAL);
-#endif
decrement_handler_count();
DBUG_RETURN(0);
}
@@ -5666,7 +5576,7 @@ log and this option does nothing anymore.",
0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files. Several paths may be specified, separated by a "
-#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__)
+#if defined(__WIN__) || defined(__NETWARE__)
"semicolon (;)"
#else
"colon (:)"
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index c80bb8bad9a..9713e4bed44 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -135,7 +135,7 @@ my_bool my_net_init(NET *net, Vio* vio)
if (vio != 0) /* If real connection */
{
net->fd = vio_fd(vio); /* For perl DBI/DBD */
-#if defined(MYSQL_SERVER) && !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
+#if defined(MYSQL_SERVER) && !defined(__WIN__)
if (!(test_flags & TEST_BLOCKING))
{
my_bool old_mode;
@@ -604,7 +604,7 @@ net_real_write(NET *net,const char *packet,ulong len)
if ((long) (length=vio_write(net->vio,pos,(uint32) (end-pos))) <= 0)
{
my_bool interrupted = vio_should_retry(net->vio);
-#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
+#if !defined(__WIN__)
if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
{
if (!thr_alarm(&alarmed,(uint) net->write_timeout,&alarm_buff))
@@ -631,7 +631,7 @@ net_real_write(NET *net,const char *packet,ulong len)
}
}
else
-#endif /* (!defined(__WIN__) && !defined(__EMX__)) */
+#endif /* !defined(__WIN__) */
if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
interrupted)
{
@@ -803,7 +803,7 @@ my_real_read(NET *net, ulong *complen)
DBUG_PRINT("info",("vio_read returned %d, errno: %d",
length, vio_errno(net->vio)));
-#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
+#if !defined(__WIN__) || defined(MYSQL_SERVER)
/*
We got an error that there was no data on the socket. We now set up
an alarm to not 'read forever', change the socket to non blocking
@@ -839,7 +839,7 @@ my_real_read(NET *net, ulong *complen)
continue;
}
}
-#endif /* (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER) */
+#endif /* (!defined(__WIN__) || defined(MYSQL_SERVER) */
if (thr_alarm_in_use(&alarmed) && !thr_got_alarm(&alarmed) &&
interrupted)
{ /* Probably in MIT threads */
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 34dcd80a236..e207a0bf633 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -83,7 +83,7 @@ static int init_failsafe_rpl_thread(THD* thd)
DBUG_RETURN(-1);
}
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !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/slave.cc b/sql/slave.cc
index 04ecc04ab17..4ab9e951813 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2601,7 +2601,7 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
DBUG_RETURN(-1);
}
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !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_base.cc b/sql/sql_base.cc
index 7499cec6147..e09fed180ba 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3000,13 +3000,13 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
if (table)
{
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__)
/* Win32 can't drop a file that is open */
if (lock_type == TL_WRITE_ALLOW_READ)
{
lock_type= TL_WRITE;
}
-#endif /* __WIN__ || OS2 */
+#endif /* __WIN__ */
table_list->lock_type= lock_type;
table_list->table= table;
table->grant= table_list->grant;
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 0aef574b3e4..946c0536897 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1713,7 +1713,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
since it does not find one in the list.
*/
pthread_mutex_lock(&di->mutex);
-#if !defined( __WIN__) && !defined(OS2) /* Win32 calls this in pthread_create */
+#if !defined( __WIN__) /* Win32 calls this in pthread_create */
if (my_thread_init())
{
strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES));
@@ -1729,7 +1729,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
strmov(thd->net.last_error,ER(thd->net.last_errno=ER_OUT_OF_RESOURCES));
goto err;
}
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !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_load.cc b/sql/sql_load.cc
index 599480e616c..bf8a6b8cfbe 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -294,7 +294,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
{
(void) fn_format(name, ex->file_name, mysql_real_data_home, "",
MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
-#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
+#if !defined(__WIN__) && ! defined(__NETWARE__)
MY_STAT stat_info;
if (!my_stat(name,&stat_info,MYF(MY_WME)))
DBUG_RETURN(TRUE);
@@ -302,9 +302,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
// if we are not in slave thread, the file must be:
if (!thd->slave_thread &&
!((stat_info.st_mode & S_IROTH) == S_IROTH && // readable by others
-#ifndef __EMX__
(stat_info.st_mode & S_IFLNK) != S_IFLNK && // and not a symlink
-#endif
((stat_info.st_mode & S_IFREG) == S_IFREG ||
(stat_info.st_mode & S_IFIFO) == S_IFIFO)))
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ee0120092a2..c63a5c23d60 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -118,10 +118,6 @@ static void test_signal(int sig_ptr)
#if !defined( DBUG_OFF)
MessageBox(NULL,"Test signal","DBUG",MB_OK);
#endif
-#if defined(OS2)
- fprintf(stderr, "Test signal %d\n", sig_ptr);
- fflush(stderr);
-#endif
}
static void init_signals(void)
{
@@ -1092,7 +1088,7 @@ pthread_handler_t handle_one_connection(void *arg)
pthread_detach_this_thread();
-#if !defined( __WIN__) && !defined(OS2) // Win32 calls this in pthread_create
+#if !defined( __WIN__) // Win32 calls this in pthread_create
/* The following calls needs to be done before we call DBUG_ macros */
if (!(test_flags & TEST_NO_THREADS) & my_thread_init())
{
@@ -1116,7 +1112,7 @@ pthread_handler_t handle_one_connection(void *arg)
#if defined(__WIN__)
init_signals();
-#elif !defined(OS2) && !defined(__NETWARE__)
+#elif !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
@@ -1240,7 +1236,7 @@ pthread_handler_t handle_bootstrap(void *arg)
#ifndef EMBEDDED_LIBRARY
pthread_detach_this_thread();
thd->thread_stack= (char*) &thd;
-#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
+#if !defined(__WIN__) && !defined(__NETWARE__)
sigset_t set;
VOID(sigemptyset(&set)); // Get mask in use
VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals));
@@ -1969,9 +1965,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#ifdef __WIN__
sleep(1); // must wait after eof()
#endif
-#ifndef OS2
send_eof(thd); // This is for 'quit request'
-#endif
close_connection(thd, 0, 1);
close_thread_tables(thd); // Free before kill
kill_mysql();
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 0c08c960785..1d84c4b0f4a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3625,11 +3625,7 @@ err:
bool mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
{
-#ifdef OS2
- thr_lock_type lock_type = TL_WRITE;
-#else
thr_lock_type lock_type = TL_READ_NO_INSERT;
-#endif
DBUG_ENTER("mysql_analyze_table");
DBUG_RETURN(mysql_admin_table(thd, tables, check_opt,
@@ -3640,11 +3636,7 @@ bool mysql_analyze_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt)
bool mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
{
-#ifdef OS2
- thr_lock_type lock_type = TL_WRITE;
-#else
thr_lock_type lock_type = TL_READ_NO_INSERT;
-#endif
DBUG_ENTER("mysql_check_table");
DBUG_RETURN(mysql_admin_table(thd, tables, check_opt,
@@ -4998,7 +4990,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
}
-#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
+#if !defined( __WIN__)
if (table->file->has_transactions())
#endif
{
@@ -5011,7 +5003,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
table=0; // Marker that table is closed
no_table_reopen= TRUE;
}
-#if (!defined( __WIN__) && !defined( __EMX__) && !defined( OS2))
+#if !defined( __WIN__)
else
table->file->extra(HA_EXTRA_FORCE_REOPEN); // Don't use this file anymore
#endif